Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@devdays
Created November 30, 2014 20:58
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/995639030b9784970522 to your computer and use it in GitHub Desktop.
Save devdays/995639030b9784970522 to your computer and use it in GitHub Desktop.
Web Worker counter - html
<!DOCTYPE HTML>
<html>
<head>
<title>Worker example: One-core computation</title>
</head>
<body>
<p>The biggest number so far is: <output id="result"></output></p>
<script>
var worker = new Worker('counter.js');
worker.onmessage = function (e) {
document.getElementById('result').textContent = e.data;
};
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment