HTML and CSS Reference
In-Depth Information
It's also useful to be able to poke around inside a worker, some-
thing I've found to be exceptionally useful when experimenting
in JavaScript. In a nonworker environment, I can pop open my
console of choice (Firebug or Dragonfly, for example) and from
within there, I can log out and inspect all the properties on the
window object, the document , and then their properties, just to see
what's supported and what I can play with. Since a worker is a
closed environment, I need to do this manually. So one of the
online examples for this topic includes a console that allows you
to inspect a Web Worker and test code inside the worker and
see what it produces. You can see the worker console at http:// ( Figure 10.4 ).
FIguRE 10.4 A demo console
to inspect inside a Web Worker.
There are a number of APIs that use similar messaging tech-
niques—we'll cover more in the next chapter. Once you've got
your head around all the different ways you can communicate
within your web app, you have all the tools at your disposal to
create multi-threaded, multi-window, cross-domain thingamajigs.
Web Workers absolutely provide what has been eagerly
awaited: the ability to run background JavaScript jobs that don't
lock your user out of a browsing experience. Now that you've
seen that it's easy-peasy, I'm confident your websites will be
safe from the beach ball of death!
Search WWH ::

Custom Search