js判断移动端还是pc端
作者:互联网
function isMobile() {
let userAgentInfo = navigator.userAgent;
let Agents = ['Android', 'iPhone', 'SymbianOS', 'Windows Phone', 'iPad', 'iPod'];
let getArr = Agents.filter(i => userAgentInfo.includes(i));
return getArr.length ? true : false;
}
判断是否是pc端
- true: 移动端
- false: pc端
标签:false,getArr,js,pc,let,userAgentInfo,移动,true 来源: https://www.cnblogs.com/panwudi/p/16596699.html