判断h5打开方式是Android?iOS?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 }