responseType is an enumerated string value specifying
the type of data contained in the response. It also lets the author change the
response type. If an empty string is set as the value of
default value of
text is used.
var type = XMLHttpRequest.responseType; XMLHttpRequest.responseType = type;
A string taken from the
XMLHttpRequestResponseType enum which specifies
what type of data the response contains.
responseType to a particular value, the author should make
sure that the server is actually sending a response compatible with that format. If
the server returns data that is not compatible with the
was set, the value of
response will be
The values supported by
responseType are the following:
- An empty
responseTypestring is treated the same as
"text", the default type.
ArrayBuffercontaining binary data.
Blobobject containing the binary data.
responseis an HTML
XMLDocument, 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.
responseis a text in a
responseis part of a streaming download; this response type is only allowed for download requests, and is only supported by Internet Explorer.
You cannot change the value of
responseType in a synchronous
XMLHttpRequest except when the request belongs to a
This restriction is designed in part to help ensure that synchronous operations aren't
used for large transactions that block the browser's main thread, thereby bogging down
the user experience.
XMLHttpRequests are asynchronous by default; they are only placed in
synchronous mode by passing
false as the value of the optional
async parameter when calling
Attempts to set the value of
ignored in a
|XMLHttpRequest||Living Standard||WHATWG living standard|
BCD tables only load in the browser