js判断设备是都是pc端

function IsPC() {
var userAgentInfo = navigator.userAgent;
var Agents = new Array("Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod");
var flag = true;
for (var v = 0; v < Agents.length; v++) {
if (userAgentInfo.indexOf(Agents[v]) > 0) {
flag = false;
break;
}
}
return flag;
}

posted @ 2018-12-19 21:16  neo_o  阅读(1295)  评论(0编辑  收藏  举报

愿你的生活只有诗和远方