zoukankan      html  css  js  c++  java
  • 判断IE浏览器的类型以及提示信息(低版本浏览器不予显示)

    //浏览器IE版本判断
    (function(window) {
        var theUA = window.navigator.userAgent.toLowerCase();
        if ((theUA.match(/msiesd+/) && theUA.match(/msiesd+/)[0]) || (theUA.match(/tridents?d+/) && theUA.match(/tridents?d+/)[0])) {
            var ieVersion = theUA.match(/msiesd+/)[0].match(/d+/)[0] || theUA.match(/tridents?d+/)[0];
            if (ieVersion < 9) {
                var str = "你的浏览器版本太低了,已经和时代脱轨了 :(";
                var str2 = "推荐使用:<a href='https://www.baidu.com/s?ie=UTF-8&wd=%E8%B0%B7%E6%AD%8C%E6%B5%8F%E8%A7%88%E5%99%A8' target='_blank' style='color:blue;'>谷歌</a>,"
                    + "<a href='https://www.baidu.com/s?ie=UTF-8&wd=%E7%81%AB%E7%8B%90%E6%B5%8F%E8%A7%88%E5%99%A8' target='_blank' style='color:blue;'>火狐</a>,"  + "<a href='https://www.baidu.com/s?ie=utf-8&f=3&rsv_bp=1&tn=baidu&wd=IE11%E6%B5%8F%E8%A7%88%E5%99%A8&oq=%25E8%25B0%25B7%25E6%25AD%258C%25E6%25B5%258F%25E8%25A7%2588%25E5%2599%25A8&rsv_pq=b8d4119a000161bd&rsv_t=0381F7aojF2j91S6s6MfveyLP4BVXVQe7l814Y8JTEWpexCGFl94WjX9F7s&rqlang=cn&rsv_enter=0&rsv_sug3=12&rsv_sug1=9&rsv_sug7=100&prefixsug=I%2526gt%253B11%25E6%25B5%258F%25E8%25A7%2588%25E5%2599%25A8&rsp=3&inputT=19433&rsv_sug4=19435' target='_blank' style='color:blue;'>IE</a>,"
                    + "其他双核极速模式";
                document.writeln("<pre style='text-align:center;color:red;background-color:#ccc; height:100%;border:0;position:fixed;top:0;left:0;100%;z-index:1234'>" +
                    "<h2 style='padding-top:200px;margin:0'><strong>" + str + "<br/></strong></h2><h2>" +
                    str2 + "</h2><h2 style='margin:0'><strong>如果你的使用的是IE浏览器,请升级到IE9及以上版本<br/></strong></h2></pre>");
                document.execCommand("Stop");
            };
        }
    })(window);

  • 相关阅读:
    链表--判断一个链表是否为回文结构
    矩阵--“之”字形打印矩阵
    二叉树——平衡二叉树,二叉搜索树,完全二叉树
    链表--反转单向和双向链表
    codeforces 490C. Hacking Cypher 解题报告
    codeforces 490B.Queue 解题报告
    BestCoder19 1001.Alexandra and Prime Numbers(hdu 5108) 解题报告
    codeforces 488A. Giga Tower 解题报告
    codeforces 489C.Given Length and Sum of Digits... 解题报告
    codeforces 489B. BerSU Ball 解题报告
  • 原文地址:https://www.cnblogs.com/supershare/p/7473765.html
Copyright © 2011-2022 走看看