onmessage = function(event) { postMessage("Got message: " + event.data); }; onerror = function(e) { postMessage(e); };