Reputation: 17427
I'm using AJAX in my web application. However the documentation says to
instead of this:
var req = new XMLHttpRequest();
do this:
var req = Components.classes["@mozilla.org/xmlextras/xmlhttprequest;1"]
.createInstance(Components.interfaces.nsIXMLHttpRequest);
Why is it better that I do this? What is the difference? Thanks in advance.
Upvotes: 2
Views: 360
Reputation: 27944
I think it has to do with chrome and non-chrome code, the
.createInstance(Components.interfaces.nsIXMLHttpRequest)
works in both cases. You should test if this is still the case.
Upvotes: 0