e2

滴滴侠,fai抖

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
 1 <script>
 2 function browserRedirect() {
 3     var sUserAgent = navigator.userAgent.toLowerCase();
 4     var bIsIpad = sUserAgent.match(/ipad/i) == "ipad";
 5     var bIsIphoneOs = sUserAgent.match(/iphone os/i) == "iphone os";
 6     var bIsMidp = sUserAgent.match(/midp/i) == "midp";
 7     var bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4";
 8     var bIsUc = sUserAgent.match(/ucweb/i) == "ucweb";
 9     var bIsAndroid = sUserAgent.match(/android/i) == "android";
10     var bIsCE = sUserAgent.match(/windows ce/i) == "windows ce";
11     var bIsWM = sUserAgent.match(/windows mobile/i) == "windows mobile";
12     if (!(bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM) ){
13         window.location.href="要跳往的PC页面";
14     } else {
15         window.location.href="要跳往的手机页面";
16     }
17 }
18 browserRedirect();
19 </script>

 

posted on 2018-05-02 20:05  纯黑Se丶  阅读(197)  评论(0编辑  收藏  举报