Skip to content

Instantly share code, notes, and snippets.

@sriram15690
Created September 14, 2016 03:03
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 sriram15690/10938b72e2f83b42054e33fd4c28f668 to your computer and use it in GitHub Desktop.
Save sriram15690/10938b72e2f83b42054e33fd4c28f668 to your computer and use it in GitHub Desktop.
var p = new Promise(function (resolve, rejeect) {
$.ajax({
url: "https://api.github.com/users/sriram15690",
type: "GET",
success: function(response){
resolve(response);
},
error: function(response) {
reject(response);
}
});
});
p.then(funciton (response) {
console.log("in then");
console.log(response);
}).catch(function (response){
console.log("in catch");
console.log(response);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment