发布网友 发布时间:2022-05-15 14:04
共1个回答
热心网友 时间:2022-05-15 15:33
/*** 获取客户端信息*/function getClientInfo(){ var userAgentInfo = navigator.userAgent; var Agents = new Array("Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"); var agentinfo = null; for (var i = 0; i < Agents.length; i++) { if (userAgentInfo.indexOf(Agents[i]) > 0) { agentinfo = userAgentInfo; break; } } if(agentinfo){return agentinfo; }else{return "PC"; } }//调用示例alert( getClientInfo() );