If you use a common naming scheme (such as "job.[some unique value]" then you can submit jobs to the worker, and have them tried and retried over time.
To avoid potential threading problems:
ONLY the page can add jobs to the queue
ONLY the worker can remove the jobs, and only when a success status code is received from the server
NEVER should the page care about what jobs are in the queue, or every true to read them back, or store any other temporary list of them.
Basically, check to see if the browser supports web Workers. If they do:
To avoid potential threading problems: