您可以尝试运行以下代码来检测Web浏览器中可用的Web Worker功能:
<!DOCTYPE HTML> <html> <head> <title>Big for loop</title> <script src = "/js/modernizr-1.5.min.js"></script> <script> function myFunction(){ if (Modernizr.webworkers) { alert("Congratulations!! You have web workers support." ); } else{ alert("Sorry!! You do not have web workers support." ); } } </script> </head> <body> <button onclick = "myFunction()">Click me</button> </body> </html>