标签:indexof agent and class navig 判断当前设备 use adr user
//判断当前设备是ios还是安卓 isAndroidOrIOS() { var u = navigator.userAgent; var isAndroid = u.indexOf(‘Android‘) > -1 || u.indexOf(‘Adr‘) > -1; //android终端 var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端 if (isAndroid) { return "android" } if (isiOS) { return "ios" } return false }
标签:indexof agent and class navig 判断当前设备 use adr user
原文地址:https://www.cnblogs.com/yixiancheng/p/12929585.html