Reputation: 354
My webservice url is http://www.webservicex.net/globalweather.asmx
and the operation is 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);
}
});
but i am getting the following error.
The status is parsererror with msg= [object Object] .
success .
undefined .
200
when i put "india" as as the input.
How to solve this issue..thanks in advance
Upvotes: 0
Views: 953
Reputation: 354
The url which i was using to get the jsonp is not actually returning the json response. Thanks @SLaks
Click here This url returns the json if somebody wants to try.
Upvotes: 2