Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

initMessageEvent method

Initializes a new cross-document message (XDM) event that the createEvent method created.

Important  As of Microsoft Edge, the createEvent()/initEvent() constructor pattern for synthetic events is deprecated. See the Synthetic Events page for more information.
 
HTML5 A vocabulary and associated APIs for HTML and XHTML, Section 6.1Internet Explorer 9

 

Syntax

var retval = MessageEvent.initMessageEvent(eventType, canBubble, cancelable, data, origin, lastEventId, source);

Parameters

eventType [in]

Type: String

One of the following values, or a user-defined custom event type:

message

An onmessage event.

canBubble [in]

Type: Boolean

true (true)

The event should propagate upward.

false (false)

The event does not propagate upward.

cancelable [in]

Type: Boolean

true (true)

The default action can be canceled.

false (false)

The default action cannot be canceled.

data [in]

Type: String

The cross-document message. This value is returned as the data attribute of the event.

origin [in]

Type: String

The originating domain of the message. This value is returned as the origin attribute of the event.

lastEventId [in]

Type: String

Not used. Set this parameter to an empty string.

source [in]

Type: IHTMLWindow2

A reference to the window that generated the event. This value is returned as the source attribute of the event.

Return value

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Standards information

Remarks

The lastEventId parameter emulates server-initiated messages, which Windows Internet Explorer 9 does not support.

See also

MessageEvent

 

 

Show:
© 2017 Microsoft