javascript - Is WeChat jssdk custom sharing unavailable?
漂亮男人
漂亮男人 2017-05-16 13:34:06
0
1
485

debug:ok The safe domain name has also been added. The official account is also a service account. I am so confused. The most important thing is that the WeChat developer tool is passed and displayed correctly.

<script src='http://res.wx.qq.com/open/js/jweixin-1.0.0.js'></script>
<script>
    $.getJSON('获取data接口', function(data) {
        data.jsApiList = ['onMenuShareTimeline','onMenuShareAppMessage'];
        wx.config(data);
        wx.ready(function () {
            wx.showOptionMenu();
            wx.onMenuShareTimeline({
                title: '分享标题', // 分享标题
                link: '分享链接', // 分享链接
                imgUrl: '分享图标', // 分享图标
                success: function (res) {
                    alert(JSON.stringify(res));
                },
                cancel:function (res) {
                    alert(JSON.stringify(res));
                },
                fail: function (res) {
                    alert(JSON.stringify(res));
                }
            });

            wx.onMenuShareAppMessage({
                title: '分享标题', // 分享标题
                desc: '分享描述', // 分享描述
                link: '分享链接', // 分享链接
                imgUrl: '分享图标', // 分享图标
                success: function (res) {
                    alert(JSON.stringify(res));
                },
                cancel: function (res) {
                    alert(JSON.stringify(res));
                },
                fail: function (res) {
                    alert(JSON.stringify(res));
                }
            });

        });
    });
</script>
漂亮男人
漂亮男人

reply all(1)
阿神
wx.onMenuShareTimeline({
    title: '分享标题', // 分享标题
    link: '分享链接', // 分享链接
    imgUrl: '分享图标', // 分享图标
    success: function (res) {
        alert(JSON.stringify(res));
    },
    cancel:function (res) {
        alert(JSON.stringify(res));
    },
    fail: function (res) {
        alert(JSON.stringify(res));
    }
});

link Is it the same domain name as the safe domain name?

What is the result of success, cancel, fail callback execution on the mobile phone?


I have answered similar questions to yours before
/q/10...

Simply wonderful. . . . = =

  1. https://mp.weixin.qq.com/wiki...

  2. https://mp.weixin.qq.com/wiki...

  3. https://mp.weixin.qq.com/wiki

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template