谷歌+分享按钮回调问题

Vic*_*tor 5 share button google-plus-one google-plus share-button

我正在尝试创建一个G + Share按钮,如果用户成功共享链接,则"oneinteinteraction"返回'confirm'.我尝试过没有成功.当我通过'onendinteraction'事件记录用户活动时,它会让我'悬停'并且永远不会返回'确认',即使用户正确地共享链接.

这是我创建的代码,它很简单:http: //codepen.io/anon/pen/DdjAo

<div class="g-plus" data-action="share" data-annotation="none" data-onendinteraction="googleEventShare" data-href="http://codepen.io/"></div>

        <script type="text/javascript">
          window.___gcfg = {lang: 'en'};

          (function() {
            var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
            po.src = 'https://apis.google.com/js/plusone.js';
            var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
          })();
        </script>


<script>
   function googleEventShare(params) {
     console.log(params.type);
   }
</script>
Run Code Online (Sandbox Code Playgroud)