共计 274 个字符,预计需要花费 1 分钟才能阅读完成。
function IsEquipment() {
var flag = "PC";
var userAgentInfo = navigator.userAgent;
var Agents = [
"Android",
"iPhone",
"SymbianOS",
"Windows Phone",
"iPad",
"iPod"
];
for (var v = 0; v < Agents.length; v++) {if (userAgentInfo.indexOf(Agents[v]) > 0) {
flag = "Mobile";
break;
}
}
return flag;
};
获取以后设施,PC—电脑,Mobile—挪动端。
正文完
发表至: javascript
2020-12-03