Skip to content

Instantly share code, notes, and snippets.

@mapsam
Created April 15, 2014 21:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mapsam/10774330 to your computer and use it in GitHub Desktop.
Save mapsam/10774330 to your computer and use it in GitHub Desktop.
GET ajax
function init() {
var url = 'http://api.example.com/stuffs...'
$.ajax({
type: "GET",
dataType: "jsonp",
cache: false,
url: url,
success: function(data) {
console.log(data);
},
error: function(xhr, ajaxOptions, thrownError) {
console.log(xhr.status, thrownError);
}
});
}
window.onLoad = init();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment