I am writing a FireFox-Extension and want to load Data from Server. But when I try to initialize the XMLHttpRequest with:
var request = new XMLHttpRequest();
The error console says:
ReferenceError: XMLHttpRequest is not defined
Do I have to include something or why the XMLTttpRequest is not recognized?
XMLHttpRequest (XHR) objects are used to interact with servers. You can retrieve data from a URL without having to do a full page refresh. This enables a Web page to update just part of a page without disrupting what the user is doing. XMLHttpRequest is used heavily in AJAX programming.
The Outlook team was transferring XML from server to client, so the ActiveX control was named to reflect its primary use at the time. It was included as part of the MSXML parser.
The Add-on SDK (that you are using indirectly via the Add-on Builder) provides a request
package that is essentially a wrapper around XMLHttpRequest
, you should use it. From what I understand, you aren't given direct XMLHttpRequest
access to prevent issues if the add-on is uninstalled/disabled while a request is being performed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With