Created
April 13, 2015 12:03
-
-
Save dustintheweb/4b54045d65ce55411a1f to your computer and use it in GitHub Desktop.
Javascript to debug an ajax request
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 oXhr; | |
oXhr = new XMLHttpRequest(); | |
oXhr.id = (new Date()).getTime(); | |
oXhr.onreadystatechange = function() { | |
if (oXhr.readyState === 4 && (oXhr.status === 200)) { | |
// code stuffs | |
console.log(this.id); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment