js判断Android和iOS
var u = navigator.userAgent;
if (u.indexOf(‘Android’) > -1 || u.indexOf(‘Linux’) > -1) {
console.log(“安卓”);
} else if (u.indexOf(‘iPhone’) > -1) {
console.log(“IOS”);
} else if (u.indexOf(‘Windows Phone’) > -1) {
console.log(“Windows Phone”);
}
js判断微信和QQ
var ua = navigator.userAgent.toLowerCase();
if(ua.match(/MicroMessenger/i)==”micromessenger”) {
console.log(“微信”);
}else if(ua.match(/QQ/i) == “qq”){
console.log(“QQ”);
}
Js判断Android和IOS、微信和QQ
最新推荐文章于 2024-08-07 10:13:23 发布