码迷,mamicode.com
首页 > 其他好文 > 详细

客户端判断

时间:2015-08-06 10:43:15      阅读:115      评论:0      收藏:0      [点我收藏+]

标签:

userAgent = navigator.userAgent.toLowerCase();
isAndroid = (userAgent.indexOf("Android") > -1 ||userAgent.indexOf("android") > -1);
isiPad = userAgent.indexOf("ipad") >= 0;
isiPhone = (navigator.platform.indexOf("iPhone") != -1) || (navigator.platform.indexOf("iPod") != -1);
isWeixin = userAgent.indexOf("micromessenger") >= 0;
isWeibo = userAgent.indexOf("weibo") >= 0;



(function(){
if(/iphone|nokia|sony|ericsson|mot|samsung|sgh|lg|philips|panasonic|alcatel|lenovo|cldc|midp|wap|android|iPod/i.test(navigator.userAgent.toLowerCase())){ 
document.location.href = ‘http://114.80.151.109/spa/m/20150714/p2/‘;
}
})();

  

客户端判断

标签:

原文地址:http://www.cnblogs.com/wallaceyuan/p/4707096.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!