原文链接:https://www.cnblogs.com/mengff/p/6362128.html
//js判断是否移动端
function fIsMobile(){
return /Android|iPhone|iPad|iPod|BlackBerry|webOS|Windows
Phone|SymbianOS|IEMobile|Opera Mini/i.test(navigator.userAgent);
}
上面那个试过,OK
//js判断是否ios或Android
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终端