代码
if(window.location.toString().indexOf('pref=padindex') != -1){
}else{
if(/AppleWebKit.*Mobile/i.test(navigator.userAgent) || (/MIDP|SymbianOS|NOKIA|SAMSUNG|LG|NEC|TCL|Alcatel|BIRD|DBTEL|Dopod|PHILIPS|HAIER|LENOVO|MOT-|Nokia|SonyEricsson|SIE-|Amoi|ZTE/.test(navigator.userAgent))){
if(window.location.href.indexOf("?mobile")<0){
try{
if(/Android|Windows Phone|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){
window.location.href="http://m.mkemai.com/index.html";
}else if(/iPad/i.test(navigator.userAgent)){
window.location.href="http://m.mkemai.com/index.html"
}else{
window.location.href="http://www.mkemai.com/index.html"
}
}catch(e){}
}
}
}
判断PC端与移动端的访问
最新推荐文章于 2024-06-12 17:07:40 发布