initErrorEvent method
Creates an Error Event that can be dispatched from a JavaScript client.
Important As of Microsoft Edge, the
createEvent()/initEvent() constructor pattern for synthetic events is deprecated. See the Synthetic Events page for more information.![]() |
Syntax
var retval = ErrorEvent.initErrorEvent(typeArg, canBubbleArg, cancelableArg, messageArg, filenameArg, linenoArg);Parameters
- typeArg [in]
-
Type: DOMString
The type of the event being created
- canBubbleArg [in]
-
Type: boolean
Indicates whether the event can bubble. When true the event should propagate upward. When false the event does not propagate upward.
- cancelableArg [in]
-
Type: boolean
Indicates whether the event’s default action can be prevented. When true, the default action can be canceled. When false, the default action cannot be canceled.
- messageArg [in]
-
Type: DOMString
The error message string.
- filenameArg [in]
-
Type: DOMString
The absolute URL of the script in which the error originally occurred.
- linenoArg [in]
-
Type: unsigned long
The line number where the error occurred in the script.
Return value
Type: HRESULT
This method can return one of these values.
- S_OK
See also
Show:
