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 13:59  TigerZhang  阅读(418)  评论(0)    收藏  举报