Aborts the request if it has already been sent.
The EventTarget.addEventListener() method registers the specified listener on the EventTarget it's called on.
The EventTarget.addEventListener() method registers the specified listener on the EventTarget it's called on. The event target may be an Element in a document, the Document itself, a Window, or any other object that supports events (such as XMLHttpRequest).
This implementation accepts a settings object of type EventListenerOptions.
The EventTarget.addEventListener() method registers the specified listener on the EventTarget it's called on.
The EventTarget.addEventListener() method registers the specified listener on the EventTarget it's called on. The event target may be an Element in a document, the Document itself, a Window, or any other object that supports events (such as XMLHttpRequest).
Dispatches an Event at the specified EventTarget, invoking the affected EventListeners in the appropriate order.
Dispatches an Event at the specified EventTarget, invoking the affected EventListeners in the appropriate order. The normal event processing rules (including the capturing and optional bubbling phase) apply to events dispatched manually with dispatchEvent().
Initializes a request.
Initializes a request. This method is to be used from JavaScript code; to initialize a request from native code, use openRequest()instead.
The XMLHttpRequest method overrideMimeType() specifies a MIME type other than the one provided by the server to be used instead when interpreting the data being transferred in a request.
The XMLHttpRequest method overrideMimeType() specifies a MIME type other than the one provided by the server to be used instead when interpreting the data being transferred in a request. This may be used, for example, to force a stream to be treated and parsed as "text/xml", even if the server does not report it as such. This method must be called before calling send().
The state of the request: Value State Description 0 UNSENT open()has not been called yet.
The state of the request: Value State Description 0 UNSENT open()has not been called yet. 1 OPENED send()has not been called yet. 2 HEADERS_RECEIVED send() has been called, and headers and status are available. 3 LOADING Downloading; responseText holds partial data. 4 DONE The operation is complete.
Removes the event listener previously registered with EventTarget.addEventListener.
Removes the event listener previously registered with EventTarget.addEventListener.
This implementation accepts a settings object of type EventListenerOptions.
Removes the event listener previously registered with EventTarget.addEventListener.
Removes the event listener previously registered with EventTarget.addEventListener.
The response entity body according to responseType, as an ArrayBuffer, Blob, Document, JavaScript object (for "json"), or string.
The response entity body according to responseType, as an ArrayBuffer, Blob, Document, JavaScript object (for "json"), or string. This is null if the request is not complete or was not successful.
The response to the request as text, or null if the request was unsuccessful or has not yet been sent.
Can be set to change the response type.
Can be set to change the response type. Value Data type of response property "" (empty string) String (this is the default) "arraybuffer" ArrayBuffer "blob" Blob "document" Document "json" JavaScript object, parsed from a JSON string returned by the server "text" String "moz-blob" Used by Firefox to allow retrieving partial Blob data from progress events. This lets your progress event handler start processing data while it's still being received. "moz-chunked-text" Similar to "text", but is streaming. This means that the value in response is only available during dispatch of the "progress" event and only contains the data received since the last "progress" event. When response is accessed during a "progress" event it contains a string with the data. Otherwise it returns null. This mode currently only works in Firefox. "moz-chunked-arraybuffer" Similar to "arraybuffer", but is streaming. This means that the value in response is only available during dispatch of the "progress" event and only contains the data received since the last "progress" event. When response is accessed during a "progress" event it contains a string with the data. Otherwise it returns null. This mode currently only works in Firefox. Note: Starting with Gecko 11.0 (Firefox 11.0 / Thunderbird 11.0 / SeaMonkey 2.8), as well as WebKit build 528, these browsers no longer let you use the responseType attribute when performing synchronous requests. Attempting to do so throws an NS_ERROR_DOM_INVALID_ACCESS_ERR exception. This change has been proposed to the W3C for standardization.
Returns the serialized URL of the response or the empty string if the URL is null.
Returns the serialized URL of the response or the empty string if the URL is null. If the URL is returned, URL fragment if present in the URL will be stripped away. The value of responseURL will be the final URL obtained after any redirects.
This property should be a String, but it isn't implemented by IE, even as new as IE11, hence it must be UndefOr.
The response to the request as a DOM Document object, or null if the request was unsuccessful, has not yet been sent, or cannot be parsed as XML or HTML.
The response to the request as a DOM Document object, or null if the request was unsuccessful, has not yet been sent, or cannot be parsed as XML or HTML. The response is parsed as if it were a text/xml stream. When the responseType is set to "document" and the request has been made asynchronously, the response is parsed as a text/html stream. Note: If the server doesn't apply the text/xml Content-Type header, you can use overrideMimeType() to force XMLHttpRequest to parse it as XML anyway.
Sends the request.
Sends the request. If the request is asynchronous (which is the default), this method returns as soon as the request is sent. If the request is synchronous, this method doesn't return until the response has arrived.
Sets the value of an HTTP request header.
Sets the value of an HTTP request header. You must call setRequestHeader() after open(), but before send(). If this method is called several times with the same header, the values are merged into one single request header.
The status of the response to the request.
The status of the response to the request. This is the HTTP result code (for example, status is 200 for a successful request).
The response string returned by the HTTP server.
The response string returned by the HTTP server. Unlike status, this includes the entire text of the response message ("200 OK", for example).
The number of milliseconds a request can take before automatically being terminated.
The number of milliseconds a request can take before automatically being terminated. A value of 0 (which is the default) means there is no timeout. Note: You may not use a timeout for synchronous requests with an owning window.
The upload process can be tracked by adding an event listener to upload.
Indicates whether or not cross-site Access-Control requests should be made using credentials such as cookies or authorization headers.
Indicates whether or not cross-site Access-Control requests should be made using credentials such as cookies or authorization headers. The default is false. Note: This never affects same-site requests. Note: Starting with Gecko 11.0 (Firefox 11.0 / Thunderbird 11.0 / SeaMonkey 2.8), Gecko no longer lets you use the withCredentials attribute when performing synchronous requests. Attempting to do so throws an NS_ERROR_DOM_INVALID_ACCESS_ERR exception.
XMLHttpRequest is a JavaScript object that was designed by Microsoft and adopted by Mozilla, Apple, and Google. It's now being standardized in the W3C. It provides an easy way to retrieve data from a URL without having to do a full page refresh. A Web page can update just a part of the page without disrupting what the user is doing. XMLHttpRequest is used heavily in AJAX programming.
Despite its name, XMLHttpRequest can be used to retrieve any type of data, not just XML, and it supports protocols other than HTTP (including file and ftp).