The ErrorEvent interface represents events providing information related to errors in scripts or in files.
Properties
Also inherits properties from its parent Event.
ErrorEvent.messageRead only- Is a
DOMStringcontaining a human-readable error message describing the problem. ErrorEvent.filenameRead only- Is a
DOMStringcontaining the name of the script file in which the error occurred. ErrorEvent.linenoRead only- Is an
integercontaining the line number of the script file on which the error occurred. ErrorEvent.colnoRead only- Is an
integercontaining the column number of the script file on which the error occurred. ErrorEvent.errorRead only- Is a JavaScript
Objectthat is concerned by the event.
Constructor
ErrorEvent()- Creates an
ErrorEventevent with the given parameters.
Methods
Inherits methods from its parent Event.
Specifications
| Specification | Status | Comment |
|---|---|---|
| WHATWG HTML Living Standard The definition of 'ErrorEvent' in that specification. |
Living Standard | Added the error property and the 5th parameter to the constructor. |
| HTML5 The definition of 'ErrorEvent' in that specification. |
Recommendation | Initial definition. |
Browser compatibility
| Feature | Chrome | Edge | Firefox (Gecko) | Internet Explorer | Opera | Safari |
|---|---|---|---|---|---|---|
| Basic support | (Yes) | (Yes) | (Yes) | (Yes) | (Yes) | (Yes) |
colno property and 4th argument to constructor |
(Yes) | (Yes) | (Yes) | ? | ? | ? |
error property and 5th argument to constructor |
(Yes) | (Yes) | (Yes) | No support | No support | No support |
| Feature | Android | Edge | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
|---|---|---|---|---|---|---|
| Basic support | (Yes) | (Yes) | (Yes) | ? | (Yes) | (Yes) |
colno property and 4th argument to constructor |
? | (Yes) | No support | ? | ? | ? |
error property and 5th argument to constructor |
No support | (Yes) | No support | No support | No support | No support |
See also
- Using web workers, most likely objects to raise such an event