The XMLHttpRequestResponseType
type is an enumerated set of strings which are used to specify the type of data contained in the response
of an XMLHttpRequest
. These values are used when getting or setting the responseType
on the request.
Values
""
- An empty
responseType
string is treated the same as"text"
, the default type. arraybuffer
- The
response
is a JavaScriptArrayBuffer
containing binary data. blob
- The
response
is aBlob
object containing the binary data. document
- The
response
is an HTMLDocument
or XMLXMLDocument
, as appropriate based on the MIME type of the received data. See HTML in XMLHttpRequest to learn more about using XHR to fetch HTML content. json
- The
response
is a JavaScript object created by parsing the contents of received data as JSON. text
- The
response
is a text in aDOMString
object. ms-stream
- The
response
is part of a streaming download; this response type is only allowed for download requests, and is only supported by Internet Explorer.
Deprecated values
moz-chunked-arraybuffer
-
A Firefox-only value which instructs
XMLHttpRequest
to deliverArrayBuffer
objects containing chunks of the incoming data. Accessingresponse
during aprogress
event returns the data received so far. Outside theprogress
event handler, the value ofresponse
is alwaysnull
. You shouldn't use this non-standard (and, as of Firefox 68, entirely removed) API; instead, consider using the Fetch API with readable streams, which offers a standard alternative to accessing the response in a streaming fashion.
Specifications
Specification | Status | Comment |
---|---|---|
XMLHttpRequest | Unknown | Live standard, latest version |
Browser compatibility
The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
responseType | Chrome Full support 31 | Edge Full support 12 | Firefox Full support 6 | IE Full support 10 | Opera Full support 18 | Safari Full support 7 | WebView Android Full support 55 | Chrome Android Full support 55 | Firefox Android Full support 50 | Opera Android Full support 42 | Safari iOS Full support 7 | Samsung Internet Android Full support 6.0 |
arraybuffer | Chrome Full support 31 | Edge Full support 12 | Firefox Full support 6 | IE Full support 10 | Opera Full support 18 | Safari Full support Yes | WebView Android Full support Yes | Chrome Android Full support Yes | Firefox Android Full support 50 | Opera Android Full support Yes | Safari iOS ? | Samsung Internet Android Full support Yes |
blob | Chrome Full support 31 | Edge Full support 12 | Firefox Full support 6 | IE Full support 10 | Opera Full support 18 | Safari Full support Yes | WebView Android Full support Yes | Chrome Android Full support Yes | Firefox Android Full support 50 | Opera Android Full support Yes | Safari iOS ? | Samsung Internet Android Full support Yes |
document | Chrome Full support 31 | Edge Full support 12 | Firefox Full support 11 | IE Full support 10 | Opera No support No | Safari Full support 7 | WebView Android Full support Yes | Chrome Android Full support Yes | Firefox Android Full support 50 | Opera Android Full support Yes | Safari iOS ? | Samsung Internet Android Full support Yes |
json | Chrome Full support 31 | Edge Full support 79 | Firefox Full support 10 | IE No support No | Opera Full support 18 | Safari Full support 7 | WebView Android Full support Yes | Chrome Android Full support Yes | Firefox Android Full support 50 | Opera Android ? | Safari iOS ? | Samsung Internet Android Full support Yes |
moz-blob | Chrome No support No | Edge No support No | Firefox No support 12 — 58 | IE No support No | Opera No support No | Safari No support No | WebView Android No support No | Chrome Android No support No | Firefox Android No support No | Opera Android No support No | Safari iOS No support No | Samsung Internet Android No support No |
moz-chunked-arraybuffer | Chrome No support No | Edge No support No | Firefox No support 14 — 68 | IE No support No | Opera No support No | Safari No support No | WebView Android No support No | Chrome Android No support No | Firefox Android No support 50 — 68 | Opera Android No support No | Safari iOS No support No | Samsung Internet Android No support No |
Legend
- Full support
- Full support
- No support
- No support
- Compatibility unknown
- Compatibility unknown
- Non-standard. Expect poor cross-browser support.
- Non-standard. Expect poor cross-browser support.
- Deprecated. Not for use in new websites.
- Deprecated. Not for use in new websites.