用js判断浏览器类型

<html>
<head>
<script type="text/javascript">
  var app=navigator.appName;
  var verStr=navigator.appVersion;
    if (app.indexOf('Netscape') != -1) {
       alert("非ie");
    }
    else if (app.indexOf('Microsoft') != -1) {
        if (verStr.indexOf("MSIE7.0")!=-1 ) {
            alert("ie7");
        } 
        else {
            alert("非ie7");
        }
    } 
</script>
</head>
<body></body>
</html>

 

相关文章:

  • 2022-12-23
  • 2021-11-04
  • 2022-01-14
  • 2021-10-16
  • 2021-11-30
  • 2022-02-03
  • 2021-06-17
猜你喜欢
  • 2022-02-01
  • 2022-01-09
  • 2022-12-23
  • 2021-12-30
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案