Skip to content

Instantly share code, notes, and snippets.

@madr
Created July 25, 2016 13:48
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 madr/57f1ef0a184dd2d23c9e8c75eb34c249 to your computer and use it in GitHub Desktop.
Save madr/57f1ef0a184dd2d23c9e8c75eb34c249 to your computer and use it in GitHub Desktop.
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