JavaScript 判断当前设备是不是移动端仍是PC

if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){
alert('移动端')
}else {
  alert('PC端')
}
相关文章
相关标签/搜索