js判断手机浏览器并跳转到手机网站

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){}
}

posted @ 2015-11-09 17:50  网络爱上点击  阅读(590)  评论(0编辑  收藏  举报