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; }
版权声明:除特别注明外,本站所有文章均为田珊珊个人博客原创
转载请注明:出处来自田珊珊个人博客 » h5 js判断是IOS系统还是android系统