判断是否在微信中打开
function isWeixin(){
var ua = window.navigator.userAgent.toLowerCase();
if(ua.match(/MicroMessenger/i) == 'micromessenger'){
return true;
}else{
return false;
}
}
判断是否在ios/安卓打开
var u = navigator.userAgent,
app = navigator.appVersion;
var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
if(isiOS) {
return 'iOS';
}else{
return 'Android';
}
网友评论