node-XMLHttpRequest icon indicating copy to clipboard operation
node-XMLHttpRequest copied to clipboard

XMLHttpRequest.DONE undefined

Open VVelda opened this issue 8 years ago • 1 comments

console.log(xhr.readyState + " " + XMLHttpRequest.DONE) 4 undefined

VVelda avatar Feb 22 '17 12:02 VVelda

Just ran into this myself. Simple fix of shimming these five lines in somewhere into the codebase; or into your own project (as a workaround) after the line var XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest;:

XMLHttpRequest.UNSENT = 0;
XMLHttpRequest.OPENED = 1;
XMLHttpRequest.HEADERS_RECEIVED = 2;
XMLHttpRequest.LOADING = 3;
XMLHttpRequest.DONE = 4;

Edit: Relevant section of the XHR spec

shirakaba avatar Jun 26 '17 12:06 shirakaba