I am doing an ajax call using jquery to get data in json format. the success callback function is called but the data is empty.
$(document).ready(function () {
$.ajax({
url: "http://apps.sungardhe.com/StudentResearch/public/Research.svc/Schools",
type: "GET",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: cbSchools
});
});
function cbSchools(data) {
if (data == null) {
alert("data is null");
return;
}
for (var school in data) {
$("#ddSchool").append("<option value='" + data[school].ShortName + "'>" + data[school].ShortName + "</option>");
}
}
using fiddler I see that the response is actually returning the json data but for some reason the jquery result object is null. can anyone tell me why?