function detect(){ var equipmentType = ""; var agent = navigator.userAgent.toLowerCase(); var android = agent.indexOf("android"); var iphone = agent.indexOf("iphone"); var ipad = agent.indexOf("ipad"); if(android != -1){ equipmentType = "android"; } if(iphone != -1 || ipad != -1){ equipmentType = "ios"; } return equipmentType; }
暂无讨论,说说你的看法吧