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 checkRates(str){ var re = /^(([1-9][0-9]*\.[0-9][0-9]*)|([0]\.[0-9][0-9]*)|([1-9][0-9]*)|([0]{1}))$; //判断字符串如果是整数不能以0开头后面加正整数,如果是浮点数整数部分不能为两个0:如00.00,如果是整数, var Sure; if (!re.test(str)){ Sure =0; }else{ Sure