首页 > 其他 > 详细

判断浏览器类型代码

时间:2018-06-12 19:01:46      阅读:184      评论:0      收藏:0      [点我收藏+]

<script type="text/javascript">
function uaredirect(murl) {
try {
if(document.getElementById("bdmark") != null) {
return
}
var urlhash = window.location.hash;
if(!urlhash.match("fromapp")) {
if((navigator.userAgent.match(/(iPhone|iPod|Android|ios|iPad)/i))) {
location.replace(murl);
}
}
} catch(err) {}
}
uaredirect("wap.html");
</script>

如果是非PC浏览,则转换wap.html

判断浏览器类型代码

原文:https://www.cnblogs.com/duxingdexin/p/9174512.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!