Skip to content

Instantly share code, notes, and snippets.

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 Qiki/6fecda566c2cf3e77f35 to your computer and use it in GitHub Desktop.
Save Qiki/6fecda566c2cf3e77f35 to your computer and use it in GitHub Desktop.
(function(XHR) {
var send = XHR.prototype.send;
XHR.prototype.send = function(data) {
var self = this;
function onReadyStateChange() {
if(self.readyState == 4 ) {
windows.location = 'ajaxHandler://' + self.url;
}
}
this.addEventListener("readystatechange", onReadyStateChange, false);
send.call(this, data);
}
})(XMLHttpRequest);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment