XMLHttpRequestResponseType - Web APIs 编辑
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
BCD tables only load in the browser
See also
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论