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.
Internet Explorer 10



var retval = ErrorEvent.initErrorEvent(typeArg, canBubbleArg, cancelableArg, messageArg, filenameArg, linenoArg);


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


This method can return one of these values.


See also