分享到微信时如何自定义文字描述和图片

document.addEventListener("WeixinJSBridgeReady",
                    function() {
                        if (WeixinJSBridge) {

              //分享给好友
                            WeixinJSBridge.on("menu:share:appmessage", function() {

                                WeixinJSBridge.invoke(
                                    "sendAppMessage",
                                    {
                                        img_url: shareData.imgUrl,
                                        link: shareData.timeLineLink,
                                        desc: shareData.tContent,
                                        title: b
                                    }, function() {});
                            });
                            WeixinJSBridge.on("menu:share:timeline", function() {
             

           //分享到朋友圈       
                                WeixinJSBridge.invoke(
                                    "shareTimeline",
                                    {
                                        img_url: shareData.imgUrl,
                                        link: shareData.timeLineLink,
                                        desc: shareData.tContent,
                                        title: b
                                    }, function() {});
                            });
                        }
                    },
                    false);               

posted @ 2014-09-04 14:57  红叶舞秋山  阅读(694)  评论(0编辑  收藏  举报