When your Web Worker code is functioning properly, what do you do about the users who have not yet upgraded their web browsers? You still want these users to use your website, despite the known issues running processor-intensive code. By activating Web Workers, you have cut off these legacy users entirely!

First, you will need to split up your CPU-intensive code into two separate files, one that provides Web Worker functionality and one that does not. This is actually already demonstrated in this chapter, as the previous sections show a legacy program running the original code and another running the Web Worker setup code.

Next, in your parent script, you will need to detect whether Web Worker support ...

Get HTML5: Your visual blueprint™ for designing rich web pages and applications now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.