var u = navigator.userAgent; //Android终端 var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //iOS终端 var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); 1.. isAndroid和isiOS是两个布尔值 //判断设备是安卓或者是ios var ua = navigator.userAgent;
引入 function uaredirect(f) { try { if (document.getElementById("bdmark") != null) { return } var b = false; if (arguments[1]) { var e = window.location.host; var a = window.location.href; if (isSubdomain(arguments[1], e) == 1) { f = f + "/#m
function getTerminalType() { //获取navigator对象 var o = navigator.userAgent, t = ""; if (/\biPhone\b|\biPad\b/.test(o) && !/android/i.test(o)) { t = "ios"; } else if (/android/i.test(o)) { t = "android"; } else if (/wind
<script> var isIe = !-[1,]; // alert('ie9 之前'+isIe); var ie = 'ActiveXObject' in window; //alert('sadsd'+ie); var ie2 = !!('ActiveXObject' in window); //alert('22222'+ie2); var ie3= !!window.ActiveXObject || !!("ActiveXObject" in window);