| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/ru/docs/Web/API/XMLHttpRequest/response | [Back] [Original] |
Get to know MDN better
This page was translated from English by the community. Learn more and join the MDN Web Docs community.
This feature is well established and works across many devices and browser versions. Its been available across browsers since 2015 ..
XMLHttpRequest response ArrayBuffer, Blob, Document, JavaScript Object DOMString responseType.
var body = XMLHttpRequest.response;
, responseType. , responseType open() , send() .
null, , , responseType "text" (""), , LOADING readyState (3).
.
"" |
responseType , "text", (, DOMString.) |
"arraybuffer" |
response JavaScript ArrayBuffer . |
"blob" |
response Blob object . |
"document" |
response HTML Document XML XMLDocument, , MIME- . . HTML in XMLHttpRequest , XHR HTML. |
"json" |
response JavaScript object, JSON. |
"text" |
response DOMString object. |
"moz-chunked-arraybuffer" |
"arraybuffer", . response progress , progress, , . response progress . progress response null. |
"ms-stream" |
response ; Internet Explorer. |
load(), . XMLHttpRequest readystatechange, readyState DONE (4) response -, load().
( responseType ).
var url = "somePage.html"; //A local page
function load(url, callback) {
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function () {
if (xhr.readyState === 4) {
callback(xhr.response);
}
};
xhr.open("GET", url, true);
xhr.send("");
}
| Specification |
|---|
| XMLHttpRequest # the-response-attribute |
XMLHttpRequest.responseText and XMLHttpRequest.responseXMLThis page was last modified on 17 . 2024 . by MDN contributors.
Your blueprint for a better internet.
Portions of this content are 19982026 by individual mozilla.org contributors. Content available under a Creative Commons license.
| Web Proxy Viewer | New URL | Original Page |