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"); 
            } 
        }

  • 相关阅读:
    Django重新构造User模型
    在docker中添加mysql在通过远程机器的访问
    php基础笔记
    mysql基础笔记整理
    redis的配置安装与使用
    c++实现对两个有序链表的连接
    java的网络编程(TCP)
    无心制作
    nacos配置服务
    声明式远程调用OpenFeign(微服务调用微服务)
  • 原文地址:https://www.cnblogs.com/AaronYang/p/3138912.html
Copyright © 2011-2022 走看看