js判断手机或Pc端登陆.并跳转到相应的页面

 <script src="~/Web/js/jquery-1.10.1.min.js"></script>
    <script>
        $(function () {
            window.location.href = /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? "/Mobile/index.html" : "/Home/WebIndex";
        })

    </script>

代码很少,但是能够实现效果,

posted @ 2017-08-04 09:16  大黄人  阅读(312)  评论(0编辑  收藏  举报