JS判断设备 检查手机系统 检测系统
2017-09-29 00:00
393 查看
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|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){ window.location.href="../m/index.html"; }else if(/iPad/i.test(navigator.userAgent)){ //ipad }else{ // 其他 } }catch(e){} } } function getPgjs(){ var agent = navigator.userAgent.toLowerCase(); var res = agent.match(/android/); if(res == "android") return res; res = agent.match(/iphone/); if(res == "iphone") return "ios"; res = agent.match(/ipad/); if(res == "ipad") return "ios"; res = agent.match(/windows/); if(res == "windows") return "wp"; return "pc"; }
相关文章推荐
- JS判断客户端系统 让ipad iphone 等手持设备自动跳到手机版
- JS判断客户端系统 让ipad iphone 等手持设备自动跳到手机版
- userAgent,JS用户代理检测——判断浏览器内核、浏览器、浏览器平台、windows操作系统版本、移动设备、游戏系统
- JS判断手机系统 ios或安卓
- js判断手机系统版本为安卓还是苹果,苹果系统版本号
- js 判断当前的手机系统类型
- js判断移动设备 并跳转到手机版
- js 判断当前的手机系统类型
- userAgent,JS用户代理检测——判断浏览器内核、浏览器、浏览器平台、windows操作系统版本、移动设备、游戏系统
- JS判断是PC浏览器还是手机设备浏览器
- JS判断移动设备最佳方法 并实现跳转至手机版网页
- js判断手机系统语言动态引入不同js文件
- js判断手机系统
- js 判断手机系统的方法
- userAgent,JS这么屌的用户代理,你造吗?——判断浏览器内核、浏览器、浏览器平台、windows操作系统版本、移动设备、游戏系统
- js 判断当前的手机系统类型
- js 判断当前的手机系统类型
- js 判断当前手机系统类型
- JS判断手机设备是苹果、安卓还是WP
- js 判断当前的手机系统类型