Skip to content

Instantly share code, notes, and snippets.

@gjohnson
Created January 18, 2011 22:30
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 gjohnson/785294 to your computer and use it in GitHub Desktop.
Save gjohnson/785294 to your computer and use it in GitHub Desktop.
Basic Ajax Promise
var jxhr = $.ajax('/foo.php', {type:'get', dataType:'json'});
xhr.success(function(response){
// do something with the resposne
});
xhr.error(function(jxhr){
// do something with jxhr
});
console.log('whats up?');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment