$(function () {

  var curWwwPath = window.document.location.href;
  var pathName = window.document.location.pathname;
  var pos = curWwwPath.indexOf(pathName);
  var localhostPaht = curWwwPath.substring(0, pos);
  var host = window.location.host;
  var sUserAgent= navigator.userAgent.toLowerCase();
  var bIsIpad= sUserAgent.match(/ipad/i) == "ipad";
  var bIsIphoneOs= sUserAgent.match(/iphone os/i) == "iphone os";
  var bIsMidp= sUserAgent.match(/midp/i) == "midp";
  var bIsUc7= sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4";
  var bIsUc= sUserAgent.match(/ucweb/i) == "ucweb";
  var bIsAndroid= sUserAgent.match(/android/i) == "android";
  var bIsCE= sUserAgent.match(/windows ce/i) == "windows ce";
  var bIsWM= sUserAgent.match(/windows mobile/i) == "windows mobile";

  if (bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM) {
    //mobile
      if ((localhostPaht +"//"+host) != 'https://m.meiwo.cn'){
         window.location.href = 'https://m.meiwo.cn';
    }
    } else {
    //pc
      if ((localhostPaht +"//" +host) != 'https://www.meiwo.cn'){
          window.location.href = 'https://www.meiwo.cn';
    }
  }

})

window.location.href = /Android|webOS|iPhone|iPad|BlackBerry/i.test(navigator.userAgent) ? "https://www.baidu.com/" :  "http://news.baidu.com/";
if(/Android|webOS|iPhone|iPad|BlackBerry/i.test(navigator.userAgent)) {
window.location.href = "https://www.baidu.com/";
} else {
window.location.href = "http://news.baidu.com/";
}

最新文章

  1. 【leetcode】Valid Sudoku
  2. HTML5触摸事件(touchstart、touchmove和touchend) (转)
  3. paip.lucene 4.3 中文语义搜索最佳实践
  4. angular 三目运算符 需要换色或style
  5. HDU 1402 fft 模板题
  6. yum 安装包的用法
  7. twitter storm源码走读之1 -- nimbus启动场景分析
  8. C类地址
  9. 【Android 界面效果20】Android GradientDrawable类的详解,设置activity的背景颜色渐变效果
  10. Linxu安装Lamp环境
  11. JQ 无刷新评论
  12. 使用 Chrome 来调试你的 Android App
  13. UISearchBar总结
  14. s=a+aa+aaa+aaaa+aa...aaaa
  15. fdisk磁盘分区与挂载
  16. SpringBoot Web开发(4) Thymeleaf模板与freemaker
  17. React Router 用法
  18. es6函数的新语法
  19. Linux - DNF包管理
  20. .NetCore 中如何实现分页以及编写一个URL分页

热门文章

  1. javascript之日期对象(Date)
  2. 八十二:memcached之python操作memcached
  3. SAP Query创建
  4. 最短路径:Dijkstra算法 C#
  5. 002. Add Two Numbers
  6. django在style的样式image url添加静态图片路径和django如何动态传入图片链接?
  7. Python爬虫学习==>第六章:爬虫的基本原理
  8. DirectX* 11 多线程渲染的性能、方法和实践
  9. 【JulyEdu-Python基础】第 2 课:关键字和循环控制
  10. python selenium API 常用方法