Having this code when running it on firebug, in the console it will show invalid label and also my success callback doesn’t fire. after fiddling my way to google about answers i found out that when using jsonp i need to parse the result and also i need to have a callback. Now i’m banging my head against the wall looking for possible answers. Can you help me with this one? THANKS.
$.ajax( {
url: 'http://localhost:8732/Service1/data/10',
type: "GET",
contentType: "application/json; charset=utf-8",
dataType: "jsonp",
processdata:true,
jsonpCallback: 'mycallback',
success : function(data) {
var json = $.parseJSON(data);
$('#items').html(json);
alert(json);
},
error : function(req, status, ex) {
alert("Lol" + ex);
}
});
}
Also the alert("Lol"+ex) will prompt LoljQuery16403233689395911671_1329386795307 was not called”
Code Sample:
References : http://api.jquery.com/jQuery.getJSON/
Edit : Code 2