//是否手机 function isMobile() { var ua = navigator.userAgent.toLowerCase(); return ua.indexOf(‘android‘) >= 0 || ua.indexOf(‘iphone‘) >= 0 || ua.indexOf(‘ipad‘) >= 0; } //是否微信端 function isWeiXin(userAgent) { var ua = navigator.userAgent.toLowerCase(); return ua.indexOf(‘micromessenger‘) >= 0; }