博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
判断pc还是手机打开跳转到别的网页
阅读量:6933 次
发布时间:2019-06-27

本文共 856 字,大约阅读时间需要 2 分钟。

function is_mobile() {    var regex_match = /(nokia|iphone|android|motorola|^mot-|softbank|foma|docomo|kddi|up.browser|up.link|htc|dopod|blazer|netfront|helio|hosin|huawei|novarra|CoolPad|webos|techfaith|palmsource|blackberry|alcatel|amoi|ktouch|nexian|samsung|^sam-|s[cg]h|^lge|ericsson|philips|sagem|wellcom|bunjalloo|maui|symbian|smartphone|midp|wap|phone|windows ce|iemobile|^spice|^bird|^zte-|longcos|pantech|gionee|^sie-|portalmmm|jigs browser|hiptop|^benq|haier|^lct|operas*mobi|opera*mini|320x320|240x320|176x220)/i;  var u = navigator.userAgent;  if (null == u) {   return true;  }  var result = regex_match.exec(u);    if (null == result) {   return false  } else {   return true  } } if (is_mobile()) {  document.location.href= 'http://3g.xftz.cn/wpwin/?from=singlemessage&isappinstalled=0'; }

 

转载于:https://www.cnblogs.com/xlj-code/p/7048351.html

你可能感兴趣的文章
mysql 查询优化 ~ select count 知多少
查看>>
P1005 矩阵取数游戏
查看>>
WCF关于VS2010的配置
查看>>
ionicView视图的生命周期
查看>>
[K/3Cloud] 单据转换插件执行顺序
查看>>
关于Nginx支持.htaccess的分析
查看>>
Android中线程与进程的理解
查看>>
win 下 nginx 的虚拟主机创建
查看>>
【转载】border:none;与border:0;的区别
查看>>
Hyperledger Fabric -- gossip 协议
查看>>
判断IE版本
查看>>
静态函数造成GC的原因
查看>>
windows phone 使用bing map 服务
查看>>
Elasticsearch索引原理
查看>>
SVM核技巧之终极分析
查看>>
hdu2089 不要62 数位DP
查看>>
GetSchema取得数据库架构,无法取得列的Description属性的解决方法
查看>>
jQuery链式操作
查看>>
课本235页2-3题
查看>>
Windows CMD命令大全
查看>>