1.引入该文件<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
2.
//微信分享
var now_url=window.location.href;
$.ajax({
url : '链接',
type : "get",
dataType : "json",
async : false,
data:{
'accesstoken':'token值',
'url':now_url //当前网址
},
success : function(data) {
wx.config({
debug: false,
appId: data.appId,
timestamp: data.timestamp,
nonceStr: data.nonceStr ,
signature: data.signature ,
jsApiList: [
'showOptionMenu',
'onMenuShareTimeline',
'onMenuShareAppMessage'
]
});
},