判断是否移动端

if(/(iPhone|iPad|iPod|iOS|Android)/i.test(navigator.userAgent)) {
    console.log('是');
} else {
    console.log('否');
}

 

posted @ 2018-08-14 10:11  青芒灬  阅读(111)  评论(0编辑  收藏  举报