Created
September 14, 2016 03:03
-
-
Save sriram15690/10938b72e2f83b42054e33fd4c28f668 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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