我的网络服务网址是http://www.webservicex.net/globalweather.asmx
操作是 GetCitiesByCountry
$.ajax({
type: 'POST',
url: "http://www.webservicex.net/globalweather.asmx?op=GetCitiesByCountry",
data: "{'CountryName':'" + user + "'}",
contentType: "application/json; charset=utf-8",
dataType: "jsonp",
crossDomain: true,
success: function (msg, status) {
alert("successful");
console.log(msg.d);
},
error: function (msg, status) {
alert("failure");
console.log("failure");
console.log(msg);
$('#myplace').html("The status is " + status + " with msg= " + msg + " .<br />" + msg.statusText + " .<br />" + msg.responseText + " .<br />" + msg.status);
}
});
但我收到以下错误。
The status is parsererror with msg= [object Object] .
success .
undefined .
200
当我将“印度”作为输入时。
如何解决这个问题..提前谢谢