使用JS进行pc端、手机端判断

 <script type="text/javascript">
            (function(){
                var ua = navigator.userAgent.toLowerCase();
                var bIsIpad = ua.match(/ipad/i) == "ipad";
                var bIsIphoneOs = ua.match(/iphone os/i) == "iphone os";
                var bIsAndroid = ua.match(/android/i) == "android";
                var bIsWM = ua.match(/windows mobile/i) == "windows mobile";
                if (bIsIpad || bIsIphoneOs || bIsAndroid || bIsWM) {
                    window.location.href = "fan/"
                }
            })();
        </script> 
posted @ 2015-06-23 17:48  此刻的丶  阅读(208)  评论(0编辑  收藏  举报