如何在 HTML5 检测网页浏览器支持
您可以尝试运行以下代码,来检测 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>以下是结果

广告
数据结构
网络
关系型数据库管理系统
操作系统
Java
iOS
HTML
CSS
Android
Python
C 编程语言
C++
C#
MongoDB
MySQL
Javascript
PHP