Hi,
I am fairly new to programming but I decided to tackle on developing a small Firefox extension. When I am trying to use XMLHttpRequest method, it keeps throwing the error message as attached (both cfx and jpm). I found the code below online so I have used it but no luck.
function reqListener () {
console.log(this.responseText);
}
var oReq = new XMLHttpRequest();
oReq.onload = reqListener;
oReq.open("get", "yourFile.txt", true);
oReq.send();
I also have tried: “(cmd prompt) npm install xhr2”,
then adding the line:
var XMLHttpRequest = require('xhr2');
and still no luck.
Any help would be much appreciated. I am using Firefox 39.0. I also have Developer’s Edition installed, version 41.0a2.
Thank you,