Expand a note in 5.8 (XMLHttpRequest)

This commit is contained in:
Vse Mozhe Buty 2020-11-28 19:56:23 +02:00 committed by GitHub
parent 6ec4c4fc99
commit 513d36eabf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -151,7 +151,7 @@ We can use `xhr.responseType` property to set the response format:
- `"text"` -- get as string,
- `"arraybuffer"` -- get as `ArrayBuffer` (for binary data, see chapter <info:arraybuffer-binary-arrays>),
- `"blob"` -- get as `Blob` (for binary data, see chapter <info:blob>),
- `"document"` -- get as XML document (can use XPath and other XML methods),
- `"document"` -- get as XML document (can use XPath and other XML methods) or HTML document (based on the MIME type of the received data),
- `"json"` -- get as JSON (parsed automatically).
For example, let's get the response as JSON: