Skip to content

Instantly share code, notes, and snippets.

@JossWhittle
Created August 9, 2012 02:29
Show Gist options
  • Save JossWhittle/3300385 to your computer and use it in GitHub Desktop.
Save JossWhittle/3300385 to your computer and use it in GitHub Desktop.
An example of a JSONP GET request using JQuery
$.ajax({
type: 'GET',
url: 'http://www.l2program.co.uk/ext/api/posts',
dataType: "jsonp",
data: '',
timeout: 10000,
success: function(data){
// Deal with the returned JSON stored in 'data'
},
error: function(){
// Something went wrong
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment