1
huage 2015-02-10 08:39:10 +08:00
<script type="text/javascript">
if(window.location.toString().indexOf('pref=padindex') != -1){ }else{ if(/AppleWebKit.*Mobile/i.test(navigator.userAgent) || (/MIDP|SymbianOS|NOKIA|SAMSUNG|LG|NEC|TCL|Alcatel|BIRD|DBTEL|Dopod|PHILIPS|HAIER|LENOVO|MOT-|Nokia|SonyEricsson|SIE-|Amoi|ZTE/.test(navigator.userAgent))){ if(window.location.href.indexOf("?mobile")<0){ try{ if(/Android|Windows Phone|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){ window.location.href="http://xw.qq.com/index.htm"; }else if(/iPad/i.test(navigator.userAgent)){ window.location.href="http://www.qq.com/pad/" }else{ window.location.href="http://xw.qq.com/simple/s/index/" } }catch(e){} } } } </script> 腾讯网 |
2
steeeeps 2015-02-10 09:09:58 +08:00 1
楼上的改良版,http://steeeeps.net/2015/01/14/get-client-type-by-useragent/
添加了 微信和nexus的判断 |
3
mywaiting 2015-02-10 09:20:28 +08:00
|
4
lzsadam 2015-02-10 09:24:54 +08:00 1
|
6
zenxds 2015-02-10 10:10:18 +08:00
!!navigator.userAgent.match(/AppleWebKit.*Mobile.*/) || "ontouchstart" in document.documentElement
|
7
zenxds 2015-02-10 10:11:21 +08:00
上面的会包括pad
|