判断是否微信浏览器,是的话,加入自己想加的功能

<script type="text/javascript">
//微信浏览器端隐藏微信支付宝支付
function isWeiXin() {
var ua = window.navigator.userAgent.toLowerCase();
console.log(ua); //mozilla/5.0 (iphone; cpu iphone os 9_1 like mac os x) applewebkit/601.1.46 (khtml, like gecko)version/9.0 mobile/13b143 safari/601.1
if(ua.match(/MicroMessenger/i) == 'micromessenger') {
if(screen.width > 1024) {
$('.wchat_pay').remove();
$('.alipay_pay').remove();
}
return true;

} else {
return false;
}
}
isWeiXin();//调用此方法
</script>

上一篇:'version' contains an expression but should be a constant. @ line 13, column 11问题的解决


下一篇:375. Guess Number Higher or Lower II