var ua = window.navigator.userAgent.toLowerCase(); if (ua.match(/MicroMessenger/i) == 'micromessenger') { alert('微信内打开'); }else if(ua.match(/Alipay/i)=="alipay"){ alert('支付宝端打开‘); }