javascript利用jquery-1.7.1来判断是否是谷歌Chrome浏览器


<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <meta charset="utf-8" />
    <script src="http://code.jquery.com/jquery-1.7.1.js"></script>

</head>
<body>
    <div id="dvshow" style="display:none">请开启极速模式</div>
</body>
</html>

<script>
  
    $.browser.chrome = /chrom(e|ium)/.test(navigator.userAgent.toLowerCase());

    if ($.browser.chrome) {
        window.location.href = "index.html";
    } else {
        $("#dvshow").show();
    }
</script>


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM