zoukankan      html  css  js  c++  java
  • ie no ie 判断

     wsd
    var Browser = {
        isIE: (!navigator.userAgent.match(/Gecko/) && !window.opera),
        isIE7: (navigator.userAgent.match(/MSIE\s+7/i)),
        isIE8: (navigator.userAgent.match(/MSIE\s+8/i)),
        isIE6: (!navigator.userAgent.match(/Gecko/) && !window.opera) && (!navigator.userAgent.match(/MSIE\s+7/i)) && (!navigator.userAgent.match(/MSIE\s+8/i)),
        isSafari: (navigator.userAgent.match(/Safari/i)),
        isChrome: (navigator.userAgent.toLowerCase().indexOf("chrome") > -1),
        isMac: (navigator.platform.match(/mac/i)),
        isOpera: !!window.opera,
        isWindows: navigator.platform.match(/win[0-9]+/i)
    };
      lhgcore.J 的浏览器检测
    (function(){ 

    var axt = !!window.ActiveXObject,
    b ={
        ie: axt,
        i7: axt && !!window.XMLHttpRequest,
        i8: axt && !!document.querySelectorAll,
        op: !!window.opera,
        ff: !!window.Components,
        sa: !!window.openDatabase
    };
    lhgcore.browser = b;

    })();

    /*
    var is_IE = ( navigator.appName == "Microsoft Internet Explorer" );
    var is_NN = ( navigator.appName == "Netscape" );
    if(is_IE){
    alert("This is IE!");
    } else {
    alert("This is no IE!");
    }
    */
    if (!/*@cc_on !@*/0) {
    alert(
    'no ie');
    }
    else {
    alert(
    'ie');
    }
    if (!+"\v1") {
    alert(
    'ie');
    }
    else {
    alert(
    'no ie');
    }
    var isIE = (document.all) ? true : false; if(isIE){alert("is ie")} else {alert("no ie");}
  • 相关阅读:
    最容易被淘汰的八种人
    java基础编程——用两个栈来实现一个队列
    java基础编程——重建二叉树
    java基础——多线程
    java基础编程——链表反转
    java基础——线程池
    java基础——线程
    java基础编程——二维数组中的查找
    网络编程——TCP协议和通信
    网络编程——UDP协议和通信
  • 原文地址:https://www.cnblogs.com/jikey/p/1679273.html
Copyright © 2011-2022 走看看