zoukankan      html  css  js  c++  java
  • js判断浏览器版本

     function ExisitBrower() {
            var BR = "";
            var Sys = {};
            var ua = navigator.userAgent.toLowerCase();
            var s;
            (s = ua.match(/msie ([d.]+)/)) ? Sys.ie = s[1] :
            (s = ua.match(/firefox/([d.]+)/)) ? Sys.firefox = s[1] :
            (s = ua.match(/chrome/([d.]+)/)) ? Sys.chrome = s[1] :
            (s = ua.match(/opera.([d.]+)/)) ? Sys.opera = s[1] :
            (s = ua.match(/version/([d.]+).*safari/)) ? Sys.safari = s[1] : 0;

            //以下进行测试
            if (Sys.ie) {
                BR = "IE";
            } else if (Sys.firefox) {
                BR = "FF";
            } else if (Sys.chrome) {
                BR = "CH";
                // document.write('Chrome: ' + Sys.chrome);
            }
            else if (Sys.opera) {
                BR = "OP";
                // document.write('Opera: ' + Sys.opera);
            }
            else if (Sys.safari) {
                BR = "SA";
                //  document.write('Safari: ' + Sys.safari);
            }
            return BR;
        }

    style="word-break: break-all; word-wrap: break-word;"

  • 相关阅读:
    登琴台石有感
    天台之约
    游小九寨有感
    又见白沫江
    大学生创业 提前要做好三项准备
    游十八里香草沟有感
    观响水滩瀑布有感
    创业十把金钥匙,看了非常有启发~(转)
    2009年春季商务人士最关注的经管图书
    有了你,就有了诗意的人生
  • 原文地址:https://www.cnblogs.com/blog4xy/p/3461912.html
Copyright © 2011-2022 走看看