Last active
February 12, 2017 09:58
-
-
Save fijiwebdesign/48377e5e550f0f757361f53e9d150375 to your computer and use it in GitHub Desktop.
Shared WebWorker Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
var url = 'shared-webworker.js'; | |
var worker = new SharedWorker(url); | |
console.log('Using shared worker at', url) | |
worker.port.addEventListener("message", function(e) { | |
alert(e.data); | |
}, false); | |
worker.port.start(); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment