js判断是否微信访问
文章描述:
在html上面如何使用js来判断微信访问呢?
在js里面判断是否微信访问,首先可以自定义一个判断的方法,然后进行调用。
js
function is_weixin() {
   var ua = window.navigator.userAgent.toLowerCase();
   if (ua.match(/MicroMessenger/i) == 'micromessenger') {
      return true;
   } else {
      return false;
   }
}
if(is_weixin()){
   console.log("微信浏览器");
}else{
   console.log("不是微信浏览器");
}
发布时间:2021/08/12 
                
            
发表评论