js判断手机浏览器
2014-08-04 10:10
232 查看
最新浏览器识别合并。
demo:http://v.qq.com -> http://v.qq.com/h5 http://v.qq.com/ -> http://v.qq.com/h5 http://v.qq.com/h5 -> http://v.qq.com/h5
没有判断协议,默认http://,
demo:http://v.qq.com -> http://v.qq.com/h5 http://v.qq.com/ -> http://v.qq.com/h5 http://v.qq.com/h5 -> http://v.qq.com/h5
<script type="text/javascript"> (function(W){ if(!/\/h5/.test(W.location.pathname) && /iphone|nokia|sony|ericsson|mot|samsung|sgh|lg|philips|panasonic|alcatel|lenovo|cldc|midp|wap|mobile|htc|sharp|sie-|ipod|blackberry|meizu|android|netfront|symbian|ucweb|windowsce|palm|operamini|operamobi|openwave|nexusone/i.test(navigator.userAgent.toLowerCase())){ //W.location.href = '跳转地址'; W.location.href = 'http://' + W.location.host + W.location.pathname.replace(/\/$/,'') +'/h5'+ W.location.search + W.location.hash } })(window) </script>
没有判断协议,默认http://,
相关文章推荐
- JS判断手机浏览器
- JS判断手机浏览器
- JS判断手机浏览器
- JS判断是PC浏览器还是手机设备浏览器
- JS判断手机浏览器
- JS判断手机浏览器
- JS判断手机浏览器
- 2款JS脚本判断手机浏览器跳转WAP手机网站
- JS 判断浏览器类型,包括手机类型。
- JS判断设备以及区别不同浏览器(微信、手机等)
- JS判断是电脑浏览器还是手机浏览器?
- JS判断手机浏览器
- JS判断手机浏览器
- 2款JS脚本判断手机浏览器跳转WAP手机网站
- JS判断手机浏览器
- js,php实现用ua判断手机,ipad,pc浏览器访问网页不同尺寸页
- JS判断手机浏览器
- js根据客户端浏览器类型,判断跳转官网/手机网站
- js自动判断浏览器类型跳转到手机版
- js 稍微判断下浏览器 pc 还是手机