yxlblogs
<script type="text/javascript">
    var browser = {
        versions: function() {
            var u = navigator.userAgent, app = navigator.appVersion;
            return {
//移动终端浏览器版本信息                                                              
                mobile: (!!u.match(/AppleWebKit.*Mobile/) || !!u.match(/Windows Phone/) || !!u.match(/Android/) || !!u.match(/MQQBrowser/)) && !u.match(/iPad/) //是否为移动终端                                 
            };
        }()
    };
    if (browser.versions.mobile) {
        window.location.href = "http://m.baidu.com";
    } else {
        window.location.href = "http://www.baidu.com";
    }
</script>

 

分类:

技术点:

相关文章:

  • 2022-01-16
  • 2022-01-03
  • 2021-06-29
  • 2021-12-23
  • 2021-11-24
  • 2021-06-14
  • 2022-01-10
  • 2022-12-23
猜你喜欢
  • 2021-07-03
  • 2022-12-23
  • 2022-02-08
  • 2022-12-23
  • 2021-11-25
  • 2021-11-27
  • 2022-12-23
相关资源
相似解决方案