let u = navigator.userAgent; var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
let isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
if(isAndroid){
//我是android终端
}else if(isiOS){
//我是ios终端
}else{
//我是wap
}
let u = navigator.userAgent; var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
let isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
if(isAndroid){
//我是android终端
}else if(isiOS){
//我是ios终端
}else{
//我是wap
}
转载于:https://www.cnblogs.com/zhizhic/p/9948536.html