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(兼容模式)。

 

posted @ 2016-10-20 16:07  天外有天2013  阅读(218)  评论(1编辑  收藏  举报