微信分享自定义描述、图片

<script src=”http://res.wx.qq.com/open/js/jweixin-1.0.0.js”></script>       //微信公众平台开发js文件
<script>
wx.config({
debug: false,
appId: ‘wxfb95e4025a5d4614’,   //必填
timestamp: ‘1498633007’,         //必填
nonceStr: ‘tnZJBsdrUo88MFiB’,       //必填
signature: ‘cae67a0a883822e1087cba091321b14b73152210’,      //必填
jsApiList: [
‘onMenuShareTimeline’,
‘onMenuShareAppMessage’
]
});
wx.ready(function () {
var shareData = {
title: ‘MyBolg’, // 标题
desc: ‘My blog is the ocean of space ‘, // 描述
link: ‘http://wenchuan.ink‘, // 分享的URL,必须和当前打开的网页的URL是一样的
imgUrl: ‘http://www.mafutian.net/logo.jpg’ // 缩略图地址
};
wx.onMenuShareAppMessage(shareData);
wx.onMenuShareTimeline(shareData);
});
wx.error(function (res) {
//alert(res.errMsg);//错误提示
});
</script>

发表评论

电子邮件地址不会被公开。 必填项已用*标注