function isMobile() {
const userAgentInfo = navigator.userAgent
const Agents = [
'Android',
'iPhone',
'iPad',
'iPod'
]
let flag = false
for (let v = 0; v < Agents.length; v++) {
if (userAgentInfo.indexOf(Agents[v]) > 0) {
flag = true
break
}
}
return flag
}
大前端知識庫收集分享 www.rjxgc.com 壹玖零Tech
搜羅各種前后端奇淫技巧,花式編程思想隘弊,日日更新,速來圍觀吧...