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;
}            

转自http://blog.csdn.net/wz361790599/article/details/8211877
上一篇:innerHTML、innerText、outerHTML、outerText的区别


下一篇:Android:一个高效的UI才是一个拉风的UI(一)