如果链接已成功与Google +共享按钮共享,则获取

时间:2012-08-28 10:38:34

标签: google-plus

如果在Google +中成功分享了网址,我需要知道。请注意,如果用户单击共享按钮然后关闭气泡,则还不够。我需要确定链接是共享的,以便在我的应用程序中执行某个逻辑。

是否有人愿意这样做?我需要查找onend interaction函数的“url”参数中的任何字段?

1 个答案:

答案 0 :(得分:1)

以下是演示如何将onendinteraction与Google+分享按钮结合使用的示例。

<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
<script type="text/javascript">
        function startInteraction(params) {        
            window.console.log('end interaction');
        };

        function endInteraction(params) {
            window.console.log('end interaction');
        };
</script>

<g:plus action="share" href="http://example.com" onstartinteraction="startInteraction" onendinteraction="endInteraction"></g:plus>