Skip to content

Instantly share code, notes, and snippets.

@devdays
Created November 30, 2014 21:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save devdays/c3813725cb93d992134e to your computer and use it in GitHub Desktop.
Save devdays/c3813725cb93d992134e to your computer and use it in GitHub Desktop.
Web Worker listening for event using addEventListener
var myWorker = new Worker('aWorkerTask.js');
myWorker.addEventListener('message', function(e) {
console.log("Called back by the worker!\n" + e.data);
}, false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment