zoukankan      html  css  js  c++  java
  • 获取浏览器版本

    function checkBrower() {
        var Sys = {};
        var ua = navigator.userAgent.toLowerCase();
        if (window.ActiveXObject) {
            Sys.ie = ua.match(/msie ([d.]+)/)[1];
            //获取版本
            var ie_version = 6;
            if (Sys.ie.indexOf("7") > -1) {
                ie_version = 7;
            }
            if (Sys.ie.indexOf("8") > -1) {
                ie_version = 8;
            }
            if (Sys.ie.indexOf("9") > -1) {
                ie_version = 9;
            }
            if (Sys.ie.indexOf("10") > -1) {
                ie_version = 10;
            }
            if (Sys.ie.indexOf("11") > -1) {
                ie_version = 11;
            }
        }
        else if (ua.indexOf("firefox") > -1)
            Sys.firefox = ua.match(/firefox/([d.]+)/)[1];
        else if (ua.indexOf("chrome") > -1)
            Sys.chrome = ua.match(/chrome/([d.]+)/)[1];
        else if (window.opera)
            Sys.opera = ua.match(/opera.([d.]+)/)[1];
        else if (window.openDatabase)
            Sys.safari = ua.match(/version/([d.]+)/)[1];
    }
  • 相关阅读:
    2015 8月 做题记录
    Nim及SG函数
    CodeForces
    CF 546E(最大流
    CF 544E(状压
    树形DP
    HDU 4173(计算几何
    HDU 4081(最小生成树
    codeforeces 540E(树状数组
    Linux nginx安装
  • 原文地址:https://www.cnblogs.com/sigm/p/7097849.html
Copyright © 2011-2022 走看看