Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

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