js判断是Android还是iOS

var u = navigator.userAgent,
      app = navigator.appVersion;
var isAndroid = u.indexOf(‘Android‘) > -1 || u.indexOf(‘Linux‘) > -1; //g
var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
   if (isAndroid) {
         alert("安卓机!")
   }
   if (isIOS) {
         alert("苹果果机!")
   }

 

js判断是Android还是iOS

上一篇:fatal error C1189: #error : Building MFC application with /MD[d] (CRT dll version) requires MFC sha


下一篇:无apk,怎么获取app的activity