O'Reilly logo

HTML5: Your visual blueprint™ for designing rich web pages and applications by Adam McDaniel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

FALLING BACK FOR NON-WEB WORKER BROWSERS

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required