zoukankan      html  css  js  c++  java
  • jquery 判断是否 ie6 ie7 ie8

    1. var isIE = !!window.ActiveXObject;  
    2. var isIE6 = isIE && !window.XMLHttpRequest;  
    3. var isIE8 = isIE && !!document.documentMode;  
    4. var isIE7 = isIE && !isIE6 && !isIE8; 


    var isIE = navigator.userAgent.indexOf('MSIE') != -1;
    var isIE6 = navigator.userAgent.indexOf('MSIE 6.0') != -1;
    var isIE8 = !!window.XDomainRequest && !!document.documentMode;

    <script language="javascript">
        if(window.XMLHttpRequest)//判断浏览器是否属于Mozilla,Sofari
        {
            alert("firefox");
        }
        else if(window.ActiveXObject)//判断浏览器是否属于IE
        {
            var browser=navigator.appName 
            var b_version=navigator.appVersion 
            var version=b_version.split(";"); 
            var trim_Version=version[1].replace(/[ ]/g,""); 
            if(browser=="Microsoft Internet Explorer" && trim_Version=="MSIE7.0") 
            { 
            alert("IE 7.0"); 
            } 
            else if(browser=="Microsoft Internet Explorer" && trim_Version=="MSIE6.0") 
            { 
            alert("IE 6.0"); 
            } 
        }

  • 相关阅读:
    关于android4.3 Intel X86 Atom System Image的下载
    dp和px以及sp
    Android项目结构分析
    Performance Testing
    Modifying a Request or Response
    Log Sessions to Local Database
    The Web Sessions List
    Using QuickExec
    AutoResponder Reference
    Fiddler Session标志
  • 原文地址:https://www.cnblogs.com/AaronYang/p/3138912.html
Copyright © 2011-2022 走看看