js 判断浏览器是pc端仍是移动端

if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) {
    //说明是移动端
} else {
    //说明是pc端
}
相关文章
相关标签/搜索