手机打开PC端网址自动跳转到手机站代码

<script>
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|Windows Phone|adr|AliyunOS)/i))) {
location.replace(murl);
}
}
} catch(err){}
}
</script>
<script type="text/javascript">uaredirect("http://4g.hao315.com/qianhuishg/");</script>

posted @ 2016-08-25 14:15  KSnow  阅读(4244)  评论(0编辑  收藏  举报