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/overrideMimeType below:

overrideMimeType ยท WebPlatform Docs

overrideMimeType Summary

Overrides the MIME type returned by the server.

Method of apis/xhr/XMLHttpRequestapis/xhr/XMLHttpRequest

Syntax
 .overrideMimeType();
Return Value

No return value

Examples
function handler() {
  if (xhr.readyState === 4 ) {
    if (xhr.status === 200) {
            console.log(xhr.responseText);
        }
    }
}

var xhr = new XMLHttpRequest();
xhr.overrideMimeType("text/xml");
xhr.open("GET", "http://localhost/test.xml", true);
xhr.onreadystatechange = handler;
xhr.send();
Notes

This method may be used (for example) to force a returned stream to be treated and parsed as text/xml, even if the server does not report it as such. If used, this method must be called before send().

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