A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://webplatform.github.io/docs/apis/xhr/XMLHttpRequest/response below:

response ยท WebPlatform Docs

response Summary

Returns the response entity body, which is the fragment of the entity body of the response received so far (if LOADING) or the complete entity body of the response (if DONE).

Property of apis/xhr/XMLHttpRequestapis/xhr/XMLHttpRequest

Syntax

Note: This property is read-only.

var result = element.response;
Return Value

Returns an object of type anyany

Examples

This example reads an image as a binary file and creates an 8-bit unsigned integer array from the raw bytes.

var oReq = new XMLHttpRequest();
oReq.open("GET", "/myfile.png", true);
oReq.responseType = "arraybuffer";

oReq.onload = function (oEvent) {
  var arrayBuffer = oReq.response; 
  if (arrayBuffer) {
    var byteArray = new Uint8Array(arrayBuffer);
    for (var i = 0; i < byteArray.byteLength; i++) {
      
    }
  }
};

oReq.send(null);
Related specifications
W3C XMLHttpRequest Specification
W3C Working Draft
Attributions

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4