• 判断是否为ie浏览器


    function isIE(){
        var userAgent = navigator.userAgent, 
        rMsie = /(msies|trident.*rv:)([w.]+)/, 
        rFirefox = /(firefox)/([w.]+)/, 
        rOpera = /(opera).+version/([w.]+)/, 
        rChrome = /(chrome)/([w.]+)/, 
        rSafari = /version/([w.]+).*(safari)/; 
        var browser; 
        var version; 
        var ua = userAgent.toLowerCase(); 
    
        var match = rMsie.exec(ua);    
        if (match != null) {  
            ieVersion = { browser : "IE", version : match[2] || "0" };
            return true; 
        }  
        var match = rFirefox.exec(ua);  
        if (match != null) {  
            var ffVersion = { browser : match[1] || "", version : match[2] || "0" };
            return false; 
        }  
        var match = rOpera.exec(ua);  
        if (match != null) { 
           var opVersion =  { browser : match[1] || "", version : match[2] || "0" };
           return false;
        }  
        var match = rChrome.exec(ua);  
        if (match != null) {  
    
            var chVersion = { browser : match[1] || "", version : match[2] || "0" };
            return false;
        }  
        var match = rSafari.exec(ua);  
        if (match != null) {  
    
           var sfVersion = { browser : match[2] || "", version : match[1] || "0" }; 
           return false;
        }  
        if (match != null) {  
            var ohterVersion = { browser : "", version : "0" }; 
            return false;
        }
    }
  • 相关阅读:
    KindEditor
    JS缺失错误- Uncaught SyntaxError: Unexpected token <
    JS
    SQL
    Bootstrap
    CSS-筛选 获取第一个td
    订单号创建并发问题
    保存对象时碰到的问题-列名 'Discriminator' 无效
    ViewBag对象的更改
    Kafka协议兼容性改进
  • 原文地址:https://www.cnblogs.com/stubborn-donkey/p/9116643.html
Copyright © 2020-2023  润新知