I need to do a JSONP call.
Ajax function call :
$.ajax({
url: myPath,
dataType: 'jsonp',
success: function(data) {
alert("hello");
}
});
getJSON function call :
$.getJSON(myPath + '&callback=prova?', function(data) {
alert("hello");
});
with getJSON (using &callback=prova for setting JSONP protocol) I get an error 200. .ajax() works as well. Why? I want to use getJSON here…
You should use
callback=?and notcallback=prova?if you want your request to be treated as JSONP: