Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
postMessage
Collapse the table of content
Expand the table of content

postMessage method

Sends a message from the worker to the parent thread.

Syntax

object.postMessage(data, ports)

Parameters

data [in]

Type: any

One of the following:

postMessage cannot send a function as a message.

ports [optional]

Type: any

Return value

This method does not return a value.

Remarks

A message can be a JavaScript primitive, object, or array, but not a function.

See also

Worker
WorkerGlobalScope

 

 

Show:
© 2015 Microsoft