下面這段代碼是判斷瀏覽器是手機瀏覽器,然后自動跳轉到mobile.com,請問怎么修改,才能把不是用手機瀏覽器的人,在上mobile.com的時候,自動跳轉到PC.COM,謝謝。<script type="text/javascript">
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|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){
window.location.href="http://www.mobile.com";
}else if(/iPad/i.test(navigator.userAgent)){
}else{
window.location.href="http://www.mobile.com"
}
}catch(e){}
}
}
</script>
非手機瀏覽器上Mobile網站時如何自動跳轉到PC端?
慕斯709654
2018-08-07 11:21:55