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 646741 of ErrorEvent

  • Revision slug: Web/API/ErrorEvent
  • Revision title: ErrorEvent
  • Revision id: 646741
  • Created:
  • Creator: agentme
  • Is current revision? No
  • Comment
Tags: 

Revision Content

{{APIRef("Event")}}

The ErrorEvent interface represents events providing information related to errors in scripts or in files.

Properties

Also inherits properties from its parent {{domxref("Event")}}.

{{domxref("ErrorEvent.message")}} {{readonlyInline}}
Is a {{domxref("DOMString")}} containing a human-readable error message describing the problem.
{{domxref("ErrorEvent.filename")}} {{readonlyInline}}
Is a {{domxref("DOMString")}} containing the name of the script file in which the error occurred.
{{domxref("ErrorEvent.lineno")}} {{readonlyInline}}
Is an integer containing the line number of the script file on which the error occurred.
{{domxref("ErrorEvent.colno")}} {{readonlyInline}}
Is an integer containing the column number of the script file on which the error occurred.
{{domxref("ErrorEvent.error")}} {{readonlyInline}} {{experimental_inline}}
Is a JavaScript Object that is concerned by the event.

Constructor

{{domxref("ErrorEvent.ErrorEvent", "ErrorEvent()")}}
Creates an ErrorEvent event with the given parameters.

Methods

Inherits methods from its parent {{domxref("Event")}}.

Specifications

Specification Status Comment
{{ SpecName('HTML WHATWG', 'webappapis.html#the-errorevent-interface', 'ErrorEvent') }} {{ Spec2('HTML WHATWG') }} Added the error propriety and the 5th parameter to the constructor.
{{ SpecName('HTML5 W3C', 'webappapis.html#the-errorevent-interface', 'ErrorEvent') }} {{ Spec2('HTML5 W3C') }} Initial definition.

Browser compatibility

{{ CompatibilityTable() }}

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}}
colno property and 4th argument to constructor {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
error property and 5th argument to constructor {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatNo}} {{CompatNo}} {{CompatNo}}
Feature Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}}
colno property and 4th argument to constructor {{CompatUnknown}} {{CompatNo}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
error property and 5th argument to constructor {{CompatNo}} {{CompatNo}} {{CompatNo}} {{CompatNo}} {{CompatNo}}

See also

Revision Source

<p>{{APIRef("Event")}}</p>
<p>The <strong><code>ErrorEvent</code></strong> interface represents events providing information related to errors in scripts or in files.</p>
<h2 id="Properties">Properties</h2>
<p><em>Also inherits properties from its parent {{domxref("Event")}}</em>.</p>
<dl>
 <dt>
  {{domxref("ErrorEvent.message")}} {{readonlyInline}}</dt>
 <dd>
  Is a {{domxref("DOMString")}} containing a human-readable error message describing the problem.</dd>
 <dt>
  {{domxref("ErrorEvent.filename")}} {{readonlyInline}}</dt>
 <dd>
  Is a {{domxref("DOMString")}} containing the name of the script file in which the error occurred.</dd>
 <dt>
  {{domxref("ErrorEvent.lineno")}} {{readonlyInline}}</dt>
 <dd>
  Is an <code>integer</code> containing the line number of the script file on which the error occurred.</dd>
 <dt>
  {{domxref("ErrorEvent.colno")}} {{readonlyInline}}</dt>
 <dd>
  Is an <code>integer</code> containing the column number of the script file on which the error occurred.</dd>
 <dt>
  {{domxref("ErrorEvent.error")}} {{readonlyInline}} {{experimental_inline}}</dt>
 <dd>
  Is a JavaScript <code>Object</code> that is concerned by the event.</dd>
</dl>
<h2 id="Constructor">Constructor</h2>
<dl>
 <dt>
  {{domxref("ErrorEvent.ErrorEvent", "ErrorEvent()")}}</dt>
 <dd>
  Creates an <code>ErrorEvent</code> event with the given parameters.</dd>
</dl>
<h2 id="Methods">Methods</h2>
<p><em>Inherits methods from its parent {{domxref("Event")}}</em>.</p>
<h2 id="Specifications">Specifications</h2>
<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>{{ SpecName('HTML WHATWG', 'webappapis.html#the-errorevent-interface', 'ErrorEvent') }}</td>
   <td>{{ Spec2('HTML WHATWG') }}</td>
   <td>Added the <code>error</code> propriety and the 5th parameter to the constructor.</td>
  </tr>
  <tr>
   <td>{{ SpecName('HTML5 W3C', 'webappapis.html#the-errorevent-interface', 'ErrorEvent') }}</td>
   <td>{{ Spec2('HTML5 W3C') }}</td>
   <td>Initial definition.</td>
  </tr>
 </tbody>
</table>
<h2 id="Browser_compatibility">Browser compatibility</h2>
<p>{{ CompatibilityTable() }}</p>
<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</th>
   </tr>
   <tr>
    <td>Basic support</td>
    <td>{{CompatVersionUnknown}}</td>
    <td>{{CompatVersionUnknown}}</td>
    <td>{{CompatUnknown}}</td>
    <td>{{CompatVersionUnknown}}</td>
    <td>{{CompatVersionUnknown}}</td>
   </tr>
   <tr>
    <td><code>colno</code> property and 4th argument to constructor</td>
    <td>{{CompatVersionUnknown}}</td>
    <td>{{CompatVersionUnknown}}</td>
    <td>{{CompatUnknown}}</td>
    <td>{{CompatUnknown}}</td>
    <td>{{CompatUnknown}}</td>
   </tr>
   <tr>
    <td><code>error</code> property and 5th argument to constructor</td>
    <td>{{CompatVersionUnknown}}</td>
    <td>{{CompatVersionUnknown}}</td>
    <td>{{CompatNo}}</td>
    <td>{{CompatNo}}</td>
    <td>{{CompatNo}}</td>
   </tr>
  </tbody>
 </table>
</div>
<div id="compat-mobile">
 <table class="compat-table">
  <tbody>
   <tr>
    <th>Feature</th>
    <th>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>{{CompatVersionUnknown}}</td>
    <td>{{CompatVersionUnknown}}</td>
    <td>{{CompatUnknown}}</td>
    <td>{{CompatVersionUnknown}}</td>
    <td>{{CompatVersionUnknown}}</td>
   </tr>
   <tr>
    <td><code>colno</code> property and 4th argument to constructor</td>
    <td>{{CompatUnknown}}</td>
    <td>{{CompatNo}}</td>
    <td>{{CompatUnknown}}</td>
    <td>{{CompatUnknown}}</td>
    <td>{{CompatUnknown}}</td>
   </tr>
   <tr>
    <td><code>error</code> property and 5th argument to constructor</td>
    <td>{{CompatNo}}</td>
    <td>{{CompatNo}}</td>
    <td>{{CompatNo}}</td>
    <td>{{CompatNo}}</td>
    <td>{{CompatNo}}</td>
   </tr>
  </tbody>
 </table>
</div>
<h2 id="See_also">See also</h2>
<ul>
 <li><a href="/en-US/docs/Web/Guide/Performance/Using_web_workers" title="/en-US/docs/Web/Guide/Performance/Using_web_workers">Using web workers</a>, most likely objects to raise such an event</li>
</ul>
Revert to this revision