//获取ios浏览器主版本号
getIosVersion:function() {
var ver =this.navigator.userAgent.match(/OS (\d+)_(\d+)_?(\d+)?/);
if(ver && ver.length>1){
return parseInt(ver[1],10);
}else{
return-1;
}
}
//安卓
android:function() {
return this.navigator.userAgent.indexOf('Android') > -1||this.ua.indexOf('Linux') > -1;
},
//苹果
iPhone:function() {
return this.navigator.userAgent.indexOf('iPhone') > -1;
},
//iPad
iPad:function() {
return this.navigator.userAgent.indexOf('iPad') > -1;
},
//qq浏览器
qq:function() {
return this.navigator.userAgent.indexOf('QQBrowser') > -1;
},
//微信浏览器
weixin:function() {
return this.navigator.userAgent.indexOf('MicroMessenger') > -1;
},
网友评论