9

是否有人知道 Google 的加一按钮的某些代码可以在使用 AJAX 刷新的页面上运行?Facebook 非常简单,但我找不到任何关于 Google 的文档。

谢谢。

4

2 回答 2

18

我也在寻找这个并找到了这个

<!-- Place this tag in your head or just before your close body tag -->
<script type="text/javascript" src="https://apis.google.com/js/plusone.js">
  {parsetags: 'explicit'}
</script>

<!-- Place this tag where you want the +1 button to render -->
<g:plusone></g:plusone> 

<!-- Place this render call where appropriate -->
<script type="text/javascript">gapi.plusone.go();</script>

gapi.plusone.go();放置此代码,按钮将出现

于 2011-10-02T20:25:56.893 回答
0

如果您尝试使用 ajax 而不是 plusone 呈现人员徽章,则需要不同的 api 调用: api.person.go(); https://developers.google.com/+/web/badge/#gapi .*.go

于 2014-08-14T15:56:20.843 回答