share.js代码如下
url = location.href; $.ajax({ type: "get", url: "../js/jssdk.php?url=" + url, dataType: "jsonp", jsonp: "callback", jsonpCallback: "success_jsonpCallback", success: function(data) { wx.config({ appId: data.appId, timestamp: data.timestamp, nonceStr: data.nonceStr, signature: data.signature, jsApiList: ['chackJsApi', 'onMenuShareTimeline', 'onMenuShareAppMessage', 'onMenuShareQQ', 'onMenuShareWeibo', 'onMenuShareQZone'] }); }, error: function(data) { alert("连接失败!"); } }); wx.ready(function() { var shareData = { title: title, desc: desc, link: url, imgUrl: img, success: function(res) { //分享成功 }, cancel: function(res) { alert('已取消分享'); } }; wx.onMenuShareAppMessage(shareData); wx.onMenuShareTimeline(shareData); wx.onMenuShareQQ(shareData); wx.onMenuShareWeibo(shareData); wx.onMenuShareQZone(shareData); });网站微信自定义分享代码,可以自定义分享图片标题描述(支持https)(2)
分页标题#e#
内容版权声明:除非注明,否则皆为本站原创文章。
转载注明出处:https://www.heiqu.com/ad207619d68cae17238082e103aa3786.html