Skip to content

Instantly share code, notes, and snippets.

@snippe
Created November 15, 2014 06:03
Show Gist options
  • Save snippe/b85c00d92bdcd39c44d8 to your computer and use it in GitHub Desktop.
Save snippe/b85c00d92bdcd39c44d8 to your computer and use it in GitHub Desktop.
$.when($.ajax('http://date.jsontest.com'))
.then(function(data){
//Will be executed if the ajax is successful
console.log('data ' + data);
}).
fail(function(data){
//Will be executed if the ajax gets fails
console.log('Fail');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment