Скрипт
top.worker = new Worker('js/worker.js');
top.worker.onmessage = function (event) {
/*ответ в event.data*/
top.worker.terminate();
}
top.worker.postMessage({key1: 'value1', key2: 'value2'});
Worker
onmessage = function (event) {
var rsa = new RSAKey();
rsa.generate(parseInt(event.data.bits),event.data.dr_value);
postMessage('done');
};
http://www.w3.org/TR/2009/WD-workers-20091222/