Created
June 6, 2014 06:34
-
-
Save viko16/3daf0aa1c537775b2f41 to your computer and use it in GitHub Desktop.
微信判断 #javascript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 判断微信浏览器 | |
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