假设pc/index.html是pc端的网页,mobile/index.html是移动端的网页
在外部设置一个html进行判断,分别跳转;
//判断如果是pc端,自动跳到pc/index.html
//安卓手机自动跳到mobile/index.html
var userAgent = navigator.userAgent.toLowerCase();
if(userAgent.indexOf('android') == -1 &&
userAgent.indexOf('iphone') == -1 &&
userAgent.indexOf('ipad') == -1)
location.href = 'pc/index.html';
else
location.href = 'mobile/index.html';
版权声明:本文为z110655原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。