判断浏览器是否为ie浏览器

function isIE(){
     if (!!window.ActiveXObject || "ActiveXObject" in window) 
        return true; else return false; 
}
$(function(){
    if(isIE() == true){ 
        //alert('对,这是IE浏览器'); 
    }else{
        //alert('遗憾,这不是IE浏览器');
    }
});        

 

posted @ 2021-08-10 17:35  程序猿晓Q  阅读(141)  评论(0)    收藏  举报