js检测是否在微信中

var ua = navigator.userAgent.toLowerCase();
var position = '';
var weixin = /micromessenger/i;
if(weixin.test(ua)){
position ="weixin";
}

此处评论已关闭