手机浏览器判断 微信 支付宝

时间:2019-06-28 12:00:36   收藏:0   阅读:152
      if (/MicroMessenger/.test(window.navigator.userAgent)) { 
        return 1  //微信
      } else if (/AlipayClient/.test(window.navigator.userAgent)) { 
        return 2  //支付宝
      } else {
        return 3 //
      }

 

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!