ErrorEvent
MDN Web Docs · نسخهٔ df622a2a1c1e · CC BY-SA 2.5 و مجوز جداگانهٔ ناشر برای نمونهکد
{{APIRef("HTML DOM")}}{{AvailableInWorkers}}
The **ErrorEvent** interface represents events providing information related to errors in scripts or in files.
{{InheritanceDiagram}}
Constructor
- {{domxref("ErrorEvent.ErrorEvent", "ErrorEvent()")}}
- : Creates an
ErrorEventevent with the given parameters.
Instance properties
_Also inherits properties from its parent {{domxref("Event")}}_.
- {{domxref("ErrorEvent.message")}} {{ReadOnlyInline}}
- : A string containing a human-readable error message describing the problem.
- {{domxref("ErrorEvent.filename")}} {{ReadOnlyInline}}
- : A string containing the name of the script file in which the error occurred.
- {{domxref("ErrorEvent.lineno")}} {{ReadOnlyInline}}
- : An integer containing the line number of the script file on which the error occurred.
- {{domxref("ErrorEvent.colno")}} {{ReadOnlyInline}}
- : An integer containing the column number of the script file on which the error occurred.
- {{domxref("ErrorEvent.error")}} {{ReadOnlyInline}}
- : A JavaScript value, such as an {{jsxref("Error")}} or {{domxref("DOMException")}}, representing the error associated with this event.
Instance methods
_Inherits methods from its parent {{domxref("Event")}}_.
Specifications
{{Specifications}}
Browser compatibility
{{Compat}}
See also
- Using web workers, most likely objects to raise such an event.
- {{domxref("Window")}}: {{domxref("Window/error_event", "error")}} event
- {{domxref("Navigation")}}: {{domxref("Navigation/navigateerror_event", "navigateerror")}} event