一、识别到用户的设备是手机等移动端设备时跳转到移动端网站

var mobileAgent = new Array("iphone", "ipod", "ipad", "android", "mobile", "blackberry", "webos", "incognito", "webmate", "bada", "nokia", "lg", "ucweb", "skyfire");
    var browser = navigator.userAgent.toLowerCase();
    var isMobile = false;
    for (var i = 0; i < mobileAgent.length; i++) {
        if (browser.indexOf(mobileAgent[i]) != -1) {
            isMobile = true;
            location.href = 'http://m.sxuek.com';
            break;
        }
    }

 

相关文章:

  • 2022-12-23
  • 2021-12-06
  • 2022-12-23
  • 2021-07-03
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-08
  • 2022-02-19
相关资源
相似解决方案