Re: [whatwg] Web Workers: include simple example for shared workers

2010-02-25 Thread Simon Pieters
On Tue, 23 Feb 2010 21:36:15 +0100, Simon Pieters sim...@opera.com wrote: step 3. test.html pre id=logLog:/pre script var worker = new SharedWorker('test.js'); var log = document.getElementById('log'); worker.port.addEventListener('message', function(e) { log.textContent += '\n' + e.data;

Re: [whatwg] Web Workers: include simple example for shared workers

2010-02-25 Thread Simon Pieters
On Thu, 25 Feb 2010 18:58:37 +0100, Drew Wilson atwil...@google.com wrote: BTW, I think it's valuable to point out in the example that MessageEvent.target == the port that received the message (so we don't need to use a closure as in the example below - just use

[whatwg] Web Workers: include simple example for shared workers

2010-02-23 Thread Simon Pieters
The Web Worker's first example of shared workers is quite involved and not so easy to follow if you haven't dealt with shared workers before. For someone wanting to experiment with shared workers, it's easier to grasp how things work by doing something very basic first. It would be useful if