我尝试用 JQuery 调用 web 服务。我怎样才能使下面的代码工作?
function TEST() { var curcode = "AFA"; var serviceURL = "http://www.webservicex.net/country.asmx/GetCountryByCurrencyCode"; var requestData = "{'CurrencyCode':'" + curcode + "'}"; $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: serviceURL, data: requestData, dataType: 'json', success: function(msg) { var response = msg.d; alert("response.Message : " + response.Message); }, error: function(msg) { alert("error msg : " + msg.d); } }); } </script>
我错过了什么 ?
问候, 安德里安