Open rmhrisk opened 7 years ago
Web workers use separate threads of execution to perform work in parallel with the main thread.
We can detect if web workers are supported and degrade if it is not:
if( window.Worker /*check for support*/ ) someObject.myFunction = function() { /*algorithm that uses Web Workers*/ } else someObject.myFunction = function() { /* sad face */ }
Web workers are instantiated by calling:
new Worker(pathToJavaScriptFile);
Here is a useful post on this topic: http://codecube.net/2009/07/cross-platform-javascript-webworker/
Web workers use separate threads of execution to perform work in parallel with the main thread.
We can detect if web workers are supported and degrade if it is not:
Web workers are instantiated by calling:
Here is a useful post on this topic: http://codecube.net/2009/07/cross-platform-javascript-webworker/