<script>
var ua = navigator.userAgent;
var ipad = ua.match(/(iPad).*OS\s([\d_]+)/),
isIphone = !ipad && ua.match(/(iPhone\sOS)\s([\d_]+)/),
isAndroid = ua.match(/(Android)\s+([\d.]+)/),
isMobile = isIphone || isAndroid;
if(isMobile) {
document.write("<h1 style=' font-size:40px;'>正在跳转至手机版,请稍后!</h1>");
location.href = '/wap';
}else{
//location.href = 'http://www.domain.com';
}
//或者单独判断iphone或android
if(isIphone){
//code
}else if(isAndroid){
//code
}else{
//code
}
</script>
上一篇>>已经没有了
下一篇>>设为首页,加为收藏
Copyright © 2016 Allister All Rights Reserved