Skip to content

Instantly share code, notes, and snippets.

@gjohnson
Created January 18, 2011 22:30
Show Gist options
  • 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