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:
© 2014 Microsoft