Results 1 - 7 of 7


The ErrorEvent interface represents events providing information related to errors in scripts or in files.
API Event Worker API


The Worker() constructor creates a Worker object that executes the script at the specified URL. This script must obey the same-origin policy.
API Constructor Reference Référence Web Workers Worker


The Worker interface of the Web Workers API represents a background task that can be easily created and can send messages back to its creator. Creating a worker is as simple as calling the Worker() constructor and specifying a script to be run in the worker thread.
API DOM Interface JavaScript Reference Référence Web Workers Worker Workers


The onmessage property of the Worker interface represents an EventHandler, that is a function to be called when the message event occurs. These events are of type MessageEvent and will be called when the worker's parent receives a message (i.e. from the DedicatedWorkerGlobalScope.postMessage method.
API EventHandler onmessage Property Reference Référence Web Workers Worker


The postMessage() method of the Worker interface sends a message to the worker's inner scope. This accepts a single parameter, which is the data to send to the worker. The data may be any value or JavaScript object handled by the structured clone algorithm, which includes cyclical references.
API JavaScript Method postMessage Reference Référence Web Workers Worker


The terminate() method of the Worker interface immediately terminates the Worker. This does not offer the worker an opportunity to finish its operations; it is simply stopped at once.
API Method Reference Référence terminate Web Workers Worker