首页 > 网站 > WEB开发 > 正文

微信分享js代码(转载)

2024-04-27 14:16:09
字体:
来源:转载
供稿:网友
微信分享js代码(转载)<script>window.shareData = {//微信分享时显示的图标"imgUrl":'...", //分享链接对应的页面"timeLineLink": "...",//分享时的标题及描述"tTitle": "","tContent": ""};document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {WeixinJSBridge.on('menu:share:appmessage',function(argv) {WeixinJSBridge.invoke('sendAppMessage', {"img_url": window.shareData.imgUrl,"link": window.shareData.timeLineLink,"desc": window.shareData.tContent,"title": window.shareData.tTitle}, function () {_czc.push(["_trackEvent", "User", "ShareToSomebody", "Score", myData.score]);});});WeixinJSBridge.on('menu:share:timeline', function(argv) {WeixinJSBridge.invoke('shareTimeline', {"img_url": window.shareData.imgUrl,"img_width": "640","img_height": "640","link": window.shareData.timeLineLink,"desc": window.shareData.tContent,"title": window.shareData.tTitle}, function () {_czc.push(["_trackEvent", "User", "ShareToCircle", "Score", myData.score]);});});}, false);
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表