0

我使用脚本将移动用户重定向到移动站点版本,但我想将平板电脑用户重定向到桌面版本。脚本如下:

if ((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))) {
 location.replace("http://www.ilsanlorenzo.net/mobsite");
 }
 else if (screen.width <= 599) {
 document.location = "http://www.ilsanlorenzo.net/mobsite";
 }
 else if ( (navigator.userAgent.indexOf('Android') != -1) ) {
 document.location = "http://www.ilsanlorenzo.net/mobsite";
 }
else if ( (navigator.userAgent.indexOf('webos') != -1) ) {
 document.location = "http://www.ilsanlorenzo.net/mobsite";
 }
else if ( (navigator.userAgent.indexOf('symbian') != -1) ) {
 document.location = "http://www.ilsanlorenzo.net/mobsite";
 }
else if ( (navigator.userAgent.indexOf('blackberry') != -1) ) {
 document.location = "http://www.ilsanlorenzo.net/mobsite";
 }
else if ( (navigator.userAgent.indexOf('winphone') != -1) ) {
 document.location = "http://www.ilsanlorenzo.net/mobsite";
 }
4

0 回答 0