Skip to content

Instantly share code, notes, and snippets.

@jeffgca
Created July 29, 2016 08:13
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 jeffgca/95ee542ed836a32787df74ade37d0a58 to your computer and use it in GitHub Desktop.
Save jeffgca/95ee542ed836a32787df74ade37d0a58 to your computer and use it in GitHub Desktop.
let req = new XMLHttpRequest();
req.open('GET', data.url('testLocalXhr.json'));
req.addEventListener("abort", function() {
done();
});
req.timeout = 4000;
req.ontimeout = function () { alert("Timed out!!!"); }
req.send(null);
var abortReq = function() {
req.abort();
}
var
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment