Skip to content

Instantly share code, notes, and snippets.

@hanigamal
Created June 25, 2012 14:42
Show Gist options
  • Save hanigamal/2989063 to your computer and use it in GitHub Desktop.
Save hanigamal/2989063 to your computer and use it in GitHub Desktop.
JSONP Snipp
Since you use JSONP, you should code it like this IMHO :
$.ajax(URL, {
crossDomain:true,
dataType: "jsonp",
success:function(data,text,xhqr){
$.each(data, function(i, item) {
alert(item);
});
}
});
The correct parameter is callback but jQuery generates one automagically so dont specify it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment