JQuery 判断不同浏览器

if($.browser.msie) {          //IE浏览器
alert("this is msie"); 

else if($.browser.safari)     //safari浏览器

alert("this is safari!"); 

else if($.browser.mozilla)   //火狐浏览器

alert("this is mozilla!"); 

else if($.browser.opera) {   //opera浏览器
alert("this is opera"); 
}

else if($.browser.chrome){    //谷歌浏览器

alert("this is chrome"); 


else { 
alert("i don't konw!"); 
}

注:  一般用户常用的360安全浏览器,有两个浏览器内核,分别是chrome(极速模式)和IE(兼容模式)。

猜你喜欢

转载自blog.csdn.net/bwt1989/article/details/84262579
今日推荐