识别ios系统设备并获取版本号
作者:互联网
let isIOS = userAgent.toLowerCase().indexOf("like mac os x") > 0; //ios终端
if (isIOS) { //ios let regStr_saf = /os [\d._]*/gi; let verinfo = userAgent.toLowerCase().match(regStr_saf); var ver = (verinfo + "").replace(/[^0-9|_.]/ig, "").replace(/_/ig, "."); alert(ver); }
if (isIOS) { //ios let regStr_saf = /os [\d._]*/gi; let verinfo = userAgent.toLowerCase().match(regStr_saf); var ver = (verinfo + "").replace(/[^0-9|_.]/ig, "").replace(/_/ig, "."); alert(ver); }
标签:版本号,ios,saf,replace,let,regStr,userAgent,识别 来源: https://www.cnblogs.com/yishenweilv/p/11137831.html