top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How to use web Worker in HTML 5 ?

+1 vote
How to use web Worker in HTML 5 ?
posted May 30, 2014 by Divya Bharti

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

Web Workers are for running scripts in the background independently of any user interface scripts.

Sample Code snaps for Web Worker :
Create a Web Worker Object

 var worker = new Worker('worker.js');

Receive notifications from the worker,

worker.onmessage = function (oEvent) {
     //Called back by the worker

Start Worker

worker.postMessage(""); // start the worker 
   start it by calling the postMessage() method:
answer Jun 9, 2014 by Basabdatta Mukherjee