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

时间:2023-12-29 17:58:14

<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>