Luet tämän sisällön englanninkielistä versiota, koska tälle sisällölle ei ole vielä käännöstä. Auta meitä kääntämään tämä artikkeli!
The ErrorEvent
interface represents events providing information related to errors in scripts or in files.
Properties
Also inherits properties from its parent Event
.
ErrorEvent.message
Read only- Is a
DOMString
containing a human-readable error message describing the problem. ErrorEvent.filename
Read only- Is a
DOMString
containing the name of the script file in which the error occurred. ErrorEvent.lineno
Read only- Is an
integer
containing the line number of the script file on which the error occurred. ErrorEvent.colno
Read only- Is an
integer
containing the column number of the script file on which the error occurred. ErrorEvent.error
Read only- Is a JavaScript
Object
that is concerned by the event.
Constructor
ErrorEvent()
- Creates an
ErrorEvent
event with the given parameters.
Methods
Inherits methods from its parent Event
.
Specifications
Specification | Status | Comment |
---|---|---|
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
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Update compatibility data on GitHub
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
ErrorEvent | Chrome Full support 10 | Edge Full support Yes | Firefox Full support Yes | IE Full support Yes | Opera Full support 11 | Safari Full support Yes | WebView Android Full support Yes | Chrome Android Full support 18 | Firefox Android Full support Yes | Opera Android Full support 11 | Safari iOS Full support Yes | Samsung Internet Android ? |
ErrorEvent() constructor | Chrome Full support Yes | Edge ? | Firefox ? | IE ? | Opera Full support Yes | Safari ? | WebView Android Full support Yes | Chrome Android Full support Yes | Firefox Android ? | Opera Android Full support Yes | Safari iOS ? | Samsung Internet Android ? |
colno | Chrome Full support Yes | Edge Full support 12 | Firefox Full support Yes | IE ? | Opera Full support Yes | Safari Full support Yes | WebView Android Full support Yes | Chrome Android Full support Yes | Firefox Android Full support Yes | Opera Android Full support Yes | Safari iOS Full support Yes | Samsung Internet Android ? |
error | Chrome Full support Yes | Edge Full support 12 | Firefox Full support Yes | IE ? | Opera Full support Yes | Safari Full support Yes | WebView Android Full support Yes | Chrome Android Full support Yes | Firefox Android Full support Yes | Opera Android Full support Yes | Safari iOS Full support Yes | Samsung Internet Android ? |
filename | Chrome Full support 10 | Edge Full support 12 | Firefox Full support Yes | IE ? | Opera Full support 11 | Safari Full support Yes | WebView Android Full support Yes | Chrome Android Full support 18 | Firefox Android Full support Yes | Opera Android Full support 11 | Safari iOS Full support Yes | Samsung Internet Android ? |
lineno | Chrome Full support 10 | Edge Full support 12 | Firefox Full support Yes | IE ? | Opera Full support 11 | Safari Full support Yes | WebView Android Full support Yes | Chrome Android Full support 18 | Firefox Android Full support Yes | Opera Android Full support 11 | Safari iOS Full support Yes | Samsung Internet Android ? |
message | Chrome Full support 10 | Edge Full support 12 | Firefox Full support Yes | IE ? | Opera Full support 11 | Safari Full support Yes | WebView Android Full support Yes | Chrome Android Full support 18 | Firefox Android Full support Yes | Opera Android Full support 11 | Safari iOS Full support Yes | Samsung Internet Android ? |
Legend
- Full support
- Full support
- Compatibility unknown
- Compatibility unknown
- Experimental. Expect behavior to change in the future.
- Experimental. Expect behavior to change in the future.
See also
- Using web workers, most likely objects to raise such an event