Skip to content

Instantly share code, notes, and snippets.

@viko16
Created June 6, 2014 06:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save viko16/3daf0aa1c537775b2f41 to your computer and use it in GitHub Desktop.
Save viko16/3daf0aa1c537775b2f41 to your computer and use it in GitHub Desktop.
微信判断 #javascript
// 判断微信浏览器
function is_weixin() {
var ua = navigator.userAgent.toLowerCase();
if (ua.match(/MicroMessenger/i) == "micromessenger") {
return true;
} else {
return false;
}
}
// 判断是否是微信的粉丝
var regx_weixin = /utm_source=weixin.*&utm_medium=weixin/i;
function is_weixin_follower() {
if (regx_weixin.test(url_search_value)) {
return true;
} else {
return false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment