阅读背景:

js判断PC端 移动端 并跳转

来源:互联网 

通过JS语句判断WEB网站的访问端是电脑还是手机,以显示不同的页面!

<script>
    // PC端 移动端 跳转
    var is_mobi = navigator.userAgent.toLowerCase().match(/(ipod|iphone|android|coolpad|mmp|smartphone|midp|wap|xoom|symbian|j2me|blackberry|wince)/i) != null;
        if (is_mobi) {
            window.location.href = "mobile.html";
        }else{
            // window.location.href="/go.html?url=index.html" 
        }
</script><sc



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: