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;
}
equipmentType返回值为ios代表当前为苹果手机
equipmentType返回值为andriod代表当前为安卓手机
网友评论