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