如何将平板电脑安卓重定向到桌面版网站?

时间:2013-06-28 11:38:02

标签: android redirect tablet

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

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";
 }

0 个答案:

没有答案