首页 > 代码库 > JS 一些功能代码块[如判断设备]

JS 一些功能代码块[如判断设备]

判断是否为PC

来源:http://blog.csdn.net/seven1276/article/details/8211877

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