我使用脚本将移动用户重定向到移动网站版本,但我想在桌面版中重定向平板电脑用户。 该脚本如下:
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";
}