Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Revision 1107775 of XMLHttpRequest.overrideMimeType()

  • Revision slug: Web/API/XMLHttpRequest/overrideMimeType
  • Revision title: XMLHttpRequest.overrideMimeType()
  • Revision id: 1107775
  • Created:
  • Creator: jsx
  • Is current revision? Yes
  • Comment Just removed the placeholder Requeset content

Revision Content

{{draft}}{{APIRef('XMLHttpRequest')}}

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

void overrideMimeType(DOMString mimetype);

Syntax

// Needs content

Parameters

None.

Return value

To be written

Example

To be written

// Needs example

Specifications

Specification Status Comment
{{SpecName('XMLHttpRequest', '#the-overrideMimeType()-method', 'overrideMimeType()')}} {{Spec2('XMLHttpRequest')}} WHATWG living standard

Browser compatibility

{{CompatibilityTable}}
Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support {{CompatChrome(1)}} {{CompatUnknown}} {{CompatIe('5')}}[1]
{{CompatIe('7')}}
{{CompatVersionUnknown}} {{CompatSafari('1.2')}}
Feature Android Chrome for Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support {{CompatUnknown}} 1.0 {{CompatVersionUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}

[1] This feature was implemented via ActiveXObject(). Internet Explorer implements the standard XMLHttpRequest since version 7.

See also

Revision Source

<p>{{draft}}{{APIRef('XMLHttpRequest')}}</p>

<p>The <strong>XMLHttpRequest.overrideMimeType()</strong> method overrides the MIME type returned by the server. This may be used, for example, to force a stream to be treated and parsed as text/xml, even if the server does not report it as such. This method must be called before <code>send()</code>.</p>

<pre class="syntaxbox">
void overrideMimeType(DOMString <var>mimetype</var>);</pre>

<h2 id="Syntax">Syntax</h2>

<pre class="brush: js">
// Needs content</pre>

<h3 id="Parameters">Parameters</h3>

<p>None.</p>

<h3 id="Return_value">Return value</h3>

<p>To be written</p>

<h2 id="Example">Example</h2>

<p>To be written</p>

<pre class="brush: js" data-number="">
// Needs example</pre>

<h2 id="Specifications">Specifications</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
  <tr>
   <td>{{SpecName('XMLHttpRequest', '#the-overrideMimeType()-method', 'overrideMimeType()')}}</td>
   <td>{{Spec2('XMLHttpRequest')}}</td>
   <td>WHATWG living standard</td>
  </tr>
 </tbody>
</table>

<h2 id="Browser_compatibility">Browser compatibility</h2>

<div>{{CompatibilityTable}}</div>

<div id="compat-desktop">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Chrome</th>
   <th>Firefox (Gecko)</th>
   <th>Internet Explorer</th>
   <th>Opera</th>
   <th>Safari (WebKit)</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>{{CompatChrome(1)}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatIe('5')}}<sup>[1]</sup><br />
    {{CompatIe('7')}}</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatSafari('1.2')}}</td>
  </tr>
 </tbody>
</table>
</div>

<div id="compat-mobile">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Android</th>
   <th>Chrome for Android</th>
   <th>Firefox Mobile (Gecko)</th>
   <th>IE Mobile</th>
   <th>Opera Mobile</th>
   <th>Safari Mobile</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>{{CompatUnknown}}</td>
   <td>1.0</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
  </tr>
 </tbody>
</table>
</div>

<p>[1] This feature was implemented via ActiveXObject(). Internet Explorer implements the standard XMLHttpRequest since version 7.</p>

<h2 id="See_also">See also</h2>

<ul>
 <li><a href="/en-US/docs/Web/API/XMLHttpRequest/Using_XMLHttpRequest">Using XMLHttpRequest</a></li>
</ul>
Revert to this revision