Draft
This page is not complete.
The XMLHttpRequest.response
property returns the response's body. It can be of the type ArrayBuffer, Blob, Document, JavaScript object, or a DOMString, depending of the value of XMLHttpRequest.responseType property. Value of response
is null if the request is not complete or was not successful. However, if the value of responseType
was set to "text" or the empty string, response
can contain the partial text response while the request is still in the loading state.
Value of responseType |
Data type of response property |
"" |
DOMString (this is the default value) |
"arraybuffer" |
ArrayBuffer |
"blob" |
Blob |
"document" |
Document |
"json" |
JavaScript object, parsed from a JSON string returned by the server |
"text" |
DOMString |
"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 When This mode currently only works in Firefox. |
"moz-chunked-arraybuffer" |
Similar to When This mode currently only works in Firefox. |
"ms-stream" | Indicates that the response is part of a streaming download. It is supported only for download requests. This mode is available only in Internet Explorer. |
Example
// Example should go here
Specifications
Specification | Status | Comment |
---|---|---|
XMLHttpRequest | Living Standard | WHATWG living standard |
Browser compatibility