userAgent判断客户端,以及各个浏览器的ua

http://blog.csdn.net/yoyoosyy/article/details/70142884

navigator.userAgent.match(/Android/i)  //安卓客户端浏览器
navigator.userAgent.indexOf('iPhone') != -1)  //iPhone手机客户端
navigator.userAgent.indexOf('iPod') != -1)   //iPod 客户端
navigator.userAgent.indexOf('iPad') != -1    //iPad 客户端
<pre class="js" style="" name="code">
if(navigator.userAgent.match(/Android/i)||(navigator.userAgent.indexOf('iPhone') != -1) || (navigator.userAgent.indexOf('iPod') != -1) || (navigator.userAgent.indexOf('iPad') != -1)) {  
       $("#common_header,#common_navbar,#backtotop,#footer").hide();  
     }
</pre><br><br><br>
<p style="">uc:</p>
<p style="">Mozilla/5.0 (Linux; U;<span> </span><strong style="font-weight:700">Android</strong><span> </span>4.4.2; zh-CN; NX505J Build/KVT49L) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0<span> </span><strong style="font-weight:700">UCBrowser</strong>/10.5.2.598 U3/0.8.0 Mobile Safari/534.30</p>
<p style="">Mozilla/5.0 (iPhone; CPU<span> </span><strong style="font-weight:700">iPhone</strong><span> </span>OS 9_3_3 like Mac OS X; zh-CN) AppleWebKit/537.51.1 (KHTML, like Gecko) Mobile/13G34<span> </span><strong style="font-weight:700">UCBrowser</strong>/10.9.19.815 Mobile<br style=""></p>
<p style="">手机百度:</p>
<p style="">Mozilla/5.0 (Linux;<span> </span><strong style="font-weight:700">Android</strong><span> </span>4.4.2; NX505J Build/KVT49L) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/35.0.1916.138 Mobile Safari/537.36 T7/7.1<strong style="font-weight:700">baiduboxapp</strong>/7.5.1 (Baidu; P1 4.4.2)<br style=""></p>
<p style="">Mozilla/5.0 (iPhone; CPU<span> </span><strong style="font-weight:700">iPhone</strong><span> </span>OS 9_3_3 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Mobile/13G34<strong style="font-weight:700">baiduboxapp</strong>/0_7.0.5.7_enohpi_4331_057/3.3.9_1C2%258enohPi/1099a/B80ADBCDA918AA94450DE8767C97BC446249D6087FCLPRHEEPF/1<br style=""></p>
<p style="">百度浏览器:<br style=""></p>
<p style="">Mozilla/5.0 (Linux;<span> </span><strong style="font-weight:700">Android</strong><span> </span>4.4.2; NX505J Build/KVT49L) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/35.0.1916.138 Mobile Safari/537.36 T7/7.2<strong style="font-weight:700">baidubrowser</strong>/7.3.14.0 (Baidu; P1 4.4.2)</p>
<p style="">Mozilla/5.0 (iPhone; CPU<span> </span><strong style="font-weight:700">iPhone</strong><span> </span>OS 9_3_3 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.3 Mobile/13G34 Safari/600.1.4<strong style="font-weight:700">baidubrowser</strong>/4.2.0.324 (Baidu; P2 9.3.3)<br style=""></p>
<p style="">qq:</p>
<p style="">Mozilla/5.0 (Linux;<span> </span><strong style="font-weight:700">Android</strong><span> </span>4.4.2; NX505J Build/KVT49L) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/37.0.0.0 Mobile<span> </span><strong style="font-weight:700">MQQBrowser</strong>/6.2 TBS/036555 Safari/537.36 V1_AND_SQ_6.3.7_374_YYB_D PA QQ/6.3.7.2795 NetType/WIFI WebP/0.3.0 Pixel/1080<br style=""></p>
<p style="">Mozilla/5.0 (iPhone; CPU<span> </span><strong style="font-weight:700">iPhone</strong><span> </span>OS 9_3_3 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Mobile/13G34<span> </span><strong style="font-weight:700">QQ</strong>/6.5.0.443 V1_IPH_SQ_6.5.0_1_APP_A Pixel/750 Core/UIWebView NetType/WIFI Mem/41<br style=""></p>
<p style="">qq空间:</p>
<p style="">Mozilla/5.0 (Linux;<span> </span><strong style="font-weight:700">Android</strong><span> </span>4.4.2; NX505J Build/KVT49L) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/37.0.0.0 Mobile<span> </span><strong style="font-weight:700">MQQBrowser</strong>/6.2 TBS/036555 Safari/537.36 V1_AND_SQ_6.3.7_374_YYB_D QQ/6.3.7.2795 NetType/WIFI WebP/0.3.0 Pixel/1080<br style=""></p>
<p style="">Mozilla/5.0 (iPhone; CPU<span> </span><strong style="font-weight:700">iPhone</strong><span> </span>OS 9_3_3 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Mobile/13G34<span> </span><strong style="font-weight:700">QQ</strong>/6.5.0.443 V1_IPH_SQ_6.5.0_1_APP_A Pixel/750 Core/UIWebView NetType/WIFI Mem/169<br style=""></p>
<p style="">qq浏览器:</p>
<p style="">Mozilla/5.0 (Linux; U;<span> </span><strong style="font-weight:700">Android</strong><span> </span>4.4.2; zh-cn; NX505J Build/KVT49L) AppleWebKit/537.36 (KHTML, like Gecko)Version/4.0 Chrome/37.0.0.0<strong style="font-weight:700">MQQBrowser</strong>/6.8 Mobile Safari/537.36<br style=""></p>
<p style="">Mozilla/5.0 (iPhone 6s; CPU<span> </span><strong style="font-weight:700">iPhone</strong><span> </span>OS 9_3_3 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/6.0<span> </span><strong style="font-weight:700">MQQBrowser</strong>/6.8.1 Mobile/13G34 Safari/8536.25 MttCustomUA/2<br style=""></p>
<p style="">微信:</p>
<p style="">Mozilla/5.0 (Linux;<span> </span><strong style="font-weight:700">Android</strong><span> </span>4.4.2; NX505J Build/KVT49L) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/37.0.0.0 Mobile MQQBrowser/6.2 TBS/036548 Safari/537.36<span> </span><strong style="font-weight:700">MicroMessenger</strong>/6.3.18.800 NetType/WIFI Language/zh_CN<br style=""></p>
<p style="">Mozilla/5.0 (iPhone; CPU iPhone OS 9_3_3 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Mobile/13G34<span> </span><strong style="font-weight:700">MicroMessenger</strong>/6.3.23 NetType/WIFI Language/zh_CN<br style=""></p>
<p style="">微博:</p>
<p style="">Mozilla/5.0 (Linux;<span> </span><strong style="font-weight:700">Android</strong><span> </span>4.4.2; NX505J Build/KVT49L) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/30.0.0.0 Mobile Safari/537.36<span> </span><strong style="font-weight:700">Weibo</strong><span> </span>(nubia-NX505J__weibo__6.8.0__android__android4.4.2) tae_sdk_a_2.0.0 AliApp(BC/2.0.0)<br style=""></p>
<p style="">Mozilla/5.0 (iPhone; CPU<span> </span><strong style="font-weight:700">iPhone</strong><span> </span>OS 9_3_3 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Mobile/13G34<span> </span><strong style="font-weight:700">Weibo</strong>(iPhone8,1__weibo__6.8.1__iphone__os9.3.3) AliApp(BC/2.1) tae_sdk_ios_2.1 havana</p>
<br> 

原文链接:,转发请注明来源!
评论已关闭。