我在我的网站上呈现了谷歌+按钮,如下所示:
在JS中:
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);
Run Code Online (Sandbox Code Playgroud)
在html中:
<g:plusone size="medium" href="https://site.com"></g:plusone>
Run Code Online (Sandbox Code Playgroud)
如何为此添加回调以检测用户何时单击?我在这里看到了文档:https://developers.google.com/+/plugins/+1button/#jsapi没有看到如何使用当前渲染实现.谢谢