my jQuery.ajax returns a JSon object. At first I read other articles. but I don’t like their response text.
Content of my answer : from firebug answer
{"item":"[{\"country\":\"USA\",\"lan\":\"EN\"},{\"country\":\"Turkiye\",\"lan\":\"TR\"}]"}
Now I am trying to call countryName:
$('#loadData').click(function() {
$.ajax({
type: "POST",
url: "WS/myWS.asmx/getDaa",
data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(msg) {
$("#jsonResponse").html(msg);
$.each(msg.item, function(i, d) {
alert(this.country);
debugger;
});
},
});
});
but he warns "undefined"
source
share