JavaScript正则判断浏览器是否为手机浏览器做跳转代码

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

<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)/i))) {
                        location.replace(murl);
                }
            }
        } catch(err){}
}
</script>
<script type="text/javascript">uaredirect("http://www.xxx.com/");</script>