<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Using HTML5 Web Workers</title> <script> if(window.Worker) { // Create a new web worker var worker = new Worker("examples/resources/worker.js"); // Fire onMessage event handler worker.onmessage = function(event) { document.getElementById("result").innerHTML = event.data; }; } else { alert(" your browser do not support web worker."); } </script> </head> <body> <div id="result"> <!--Received messages will be inserted here--> </div> </body> </html>