background tasks ~= threading!

A Wikipedia:Web_worker is a single JS file that is loaded and run in the background, independently of the UI. That means it’s threaded.

 

This could almost go under JavaScript

 

http://www.html5rocks.com/en/tutorials/workers/basics/
https://developer.mozilla.org/en-US/docs/Web/Guide/Performance/Using_web_workers

 

 

I looked at omggif-worker.js as a model for a project.

 

 

Debugging

 

http://greenido.wordpress.com/2011/11/03/web-workers-part-3-out-of-3-shared-wrokers/ - has some code that will throw up the worker line-number on-error. I have not tried it.

 

var worker = new Worker("worker.js");
worker.onerror = function(e){
  throw new Error(e.message + " (" + e.filename + ":" + e.lineno + ")");
};