Web workers are a really great feature (one of the very best in my opinion) of HTML5 (see my post on web workers), but it is difficult to use them in anything more than a 'experimental features' environment, because they are not compatible with a lot of browsers (cough IE) and, given that IE6 is still being widely used, it is likely that a large percentage of web users will not be able to make full use of web workers for quite a long time (although the vast majority will be completely oblivious to this).
This puts developers in a conundrum. Any web workers they develop will also have to be implemented as synchronous JavaScript for them to work in IE and older versisons of FireFox and Chrome. This takes time, time costs money (yes it does) and so whats the point in using web workers when the performance boost is probably minimal for the sort of applications most of us are writing, and the majority of users wont be able to see that performance boost anyway.
Web workers might be a revolutionary technology in the world of JavaScript, but with the current state of web browsers, it would almost always be a big mistake for developers to spend time building web workers to handle parts of their application. The number of end users who would benefit simply would not justify the cost of developing the web workers (given that a synchronous version would also have to be developed).
Note: The above examples will try to use web workers if they are supported. Try opening up the examples in IE... the script detects that web workers are not supported and so the workers are run in synchronous mode.
You will see a performance hit. Web workers are executed synchronously, therefore if it is very computationally intensive, your pages will hang. This is the price you pay to emulate web workers in non compatible browsers.
I have uploaded the script to my github repo:*
https://github.com/guyht/GWorker</a>
Installation instructions are in the readme:
https://github.com/guyht/GWorker/blob/master/README.md</a>
But its as simple as adding this to the head of your pages:
<pre lang="HTML"><!-- Require GWorker script & jQuery -->
<script src="jquery.js" type="text/javascript"><!--mce:0--></script>
<script src="gworker.js" type="text/javascript"><!--mce:1--></script></pre>
It is also worth looking at the examples if the installation instructions are a bit confusing.
If you find a bug or are interested in contributing, feel free to fork the repository and issue pull requests.