node-XMLHttpRequest
node-XMLHttpRequest copied to clipboard
event in onreadystatechange callback is undefined
This simple example
XMLHttpRequest = require('xmlhttprequest').XMLHttpRequest;
xhr = new XMLHttpRequest();
xhr.open('GET', 'https://github.com');
xhr.onreadystatechange = function (event) {
console.log(event);
};
xhr.send();
outputs
undefined
undefined
...
undefined
I tried this with both https and http urls. I am using node v0.12.7.
I get the same thing. :+1: I need a fix to this.
+1 to this request. In the meantime @flububb's patch worked well for me too, as I only needed event.target for testing