Syntax for creating an object WORKER WEB
Creates the "wk" which is a WEB WORKER running code "worker.js"
Example of using WEB WORKER:
For example we can create the file "worker.js"
Explanation of the file "worker.js"
There is the "count" every 1000 milliseconds is increasing by 1 the value of the variable "i".
By the "postMessage" is sent back to the website the value of the variable "i".
2 - Create an object WORKER WEB on our website "worker.htm"
We have the following website "worker.htm"
Explanation of the previous file:
To verify that your browser supports WEB WORKER:
To retrieve the values that is taking our WEB WORKER "wk" and to show them in our website "worker.htm" in the "count":
To terminate the execution of our WEB WORKER "wk"