HTML DOM
The ErrorEvent() constructor creates a new ErrorEvent object.
Syntax
new ErrorEvent(type)
new ErrorEvent(type, options)
Parameters
type- : A string with the name of the event. It is case-sensitive.
options- : An object that, in addition of the properties defined in Event/Event, can have the following properties:
message- : A string containing a human-readable error message describing the problem.
filename- : A string containing the name of the script file in which the error occurred.
lineno- : An integer containing the line number of the script file on which the error occurred.
colno- : An integer containing the column number of the script file on which the error occurred.
error- : A JavaScript value, such as an Error or DOMException, representing the error associated with this event.
- : An object that, in addition of the properties defined in Event/Event, can have the following properties:
Return value
A new ErrorEvent object.
Specifications
Browser compatibility
来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。
