Created
July 25, 2016 13:48
-
-
Save madr/57f1ef0a184dd2d23c9e8c75eb34c249 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
var hijax = function (method, uri, callback) { | |
var client = new XMLHttpRequest(); | |
client.open(method, uri, true); | |
client.onload = function () { | |
if (client.status >= 200 && request.status < 400) { | |
callback(client.responseText); | |
} | |
}; | |
client.onerror = function () { | |
throw client.responseText; | |
}; | |
client.send(); | |
}; | |
hijax('POST', '/social-auth/facebook', function (r) { | |
console.log(r); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment