This page is Ready to Use

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

start

Summary

Begins dispatching messages received on the port. See Notes.

Method of apis/web-messaging/MessagePortapis/web-messaging/MessagePort

Syntax

 MessagePort.start();

Return Value

No return value

Examples

This example creates a new message channel and uses one of the ports to send a message, which will be received by the other port, and then explicitly starts sending the message.

var msgChannel = new MessageChannel();
msgChannel.port1.postMessage('Hello world');
msgChannel.port1.start();

Notes

The start method is called implicitly by when an event handler function is assigned to the onmessage property. In Internet Explorer 10, the start method is also called implicitly when a message event is registered using the addEventListener method.

Related specifications

W3C Web Messaging Specification
W3C Candidate Recommendation

Attributions