XMLHttpRequest is undefined
I'm writing a bootstrap Add-On for Thunderbird 24.3.0 on a Ubuntu 13.10 computer.
When trying to execute the following code snippet (taken for Mozilla Developer Network)
var req = new XMLHttpRequest(); req.open('GET', 'http://www.mozilla.org/', false); req.send(null); if(req.status == 200) dump(req.responseText);
I get "ReferenceError: XMLHttpRequest is not defined" on the Error Console when trying to create the object.
This problem looks very similar to Firefox's:
Additional System Details
- User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:27.0) Gecko/20100101 Firefox/27.0
Hmm, could it be some change in the SDK?
It might be worth checking on this forum: http://forums.addons.mozilla.org/
I think I found out the answer:
var req = Components.classes["@mozilla.org/xmlextras/xmlhttprequest;1"]
Anyway, thanks for letting me know about the forum. Looks helpful.