【问题标题】:Google plus custom share button callback谷歌加自定义分享按钮回调
【发布时间】:2014-11-07 18:35:41
【问题描述】:

有没有办法在用户向自定义分享按钮分享内容时添加回调?

目前我在弹出窗口中打开一个共享对话框:

<a data-height="600" data-title="Google+" class="popup" href="https://plus.google.com/share?url=MY_URL">Share</a>

$('.popup').click(function(event) {
        var width  = 575,
            height = $(this).data('height'),
            left   = ($(window).width()  - width)  / 2,
            top    = ($(window).height() - height) / 2,
            url    = this.href,
            opts   = 'status=1' +
                ',width='  + width  +
                ',height=' + height +
                ',top='    + top    +
                ',left='   + left;

        window.open(url, $(this).data('title'), opts);

        event.preventDefault();
    });

在文档中:https://developers.google.com/+/web/share/ 他们说,我们可以在使用他们的 js api 时使用 data-onendinteraction 指定回调。找不到使用自定义共享链接的方法。

【问题讨论】:

  • 您是否设法弄清楚如何做到这一点?
  • 不,很遗憾没有。

标签: javascript google-plus share


【解决方案1】:

似乎没有办法这样做。 这个确切的功能请求存在一个未解决的问题。

https://code.google.com/p/google-plus-platform/issues/detail?id=232

考虑主演和支持它,但它已经开放三年了。谷歌似乎并没有努力实现它。

【讨论】:

  • 如果不是对旧帖子的直接回答,如果是问题,您可以创建一个新问题。
猜你喜欢
  • 1970-01-01
  • 2015-11-07
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-12-30
  • 2014-03-29
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多