判断是手机还是PC端
1 function IsPC() { 2 var userAgentInfo = navigator.userAgent; 3 var Agents = ["Android", "iPhone", 4 "SymbianOS", "Windows Phone", 5 "iPad", "iPod"]; 6 var flag = true; 7 for (var v = 0; v < Agents.length; v++) { 8 if (userAgentInfo.indexOf(Agents[v]) > 0) { 9 flag = false; 10 break; 11 } 12 } 13 return flag; 14 }