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>

posted @ 2017-01-13 14:13  94cool  阅读(3261)  评论(0编辑  收藏  举报