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



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



Debugging - 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 + ")");