Created
November 19, 2015 10:21
-
-
Save svdamani/e036ab81913d3920d6f5 to your computer and use it in GitHub Desktop.
This file contains 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
(function(w) { | |
"use strict"; | |
function ajax(method, url, callback, data) { | |
return (function(x) { | |
x.onreadystatechange = function() { | |
x.readyState ^ 4 || callback(this); | |
}; | |
x.open(method, url, callback); | |
x.send(data); | |
return x; | |
})(new XMLHttpRequest()); | |
} | |
w.ajax = ajax; | |
})(window); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment