1 2 3 4 5 6 7 8 9 10 11 12 13 14
<!DOCTYPE html> <html> <head> <title>Worker test</title> </head> <body> <script> var worker = new Worker('worker.js'); worker.onmessage = function(message) { console.log(message.data); }; </script> </body> </html>