标签:mac os x mat cti type use navigator span mac os match
//判断是客户端类型 function deviceType(){ 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" }else if(isiOS){ return "Ios" } }
标签:mac os x mat cti type use navigator span mac os match
原文地址:https://www.cnblogs.com/helloNico/p/12177871.html