9

AJAX で更新されたページで動作する Google のプラス 1 ボタンのコードを知っている人はいますか? 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 を使用して人物バッジをレンダリングしようとしている場合は、別の API 呼び出しが必要です: api.person.go(); https://developers.google.com/+/web/badge/#gapi .*.go

于 2014-08-14T15:56:20.843 に答える