Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google plus-one button on a page that is refreshed with AJAX

Is anyone aware of some code for Google's plus-one button that will work on a page that is refreshed with AJAX? It was very simple with Facebook, but I can't find any documentaion about this for Google.

Thanks.

like image 693
David Gard Avatar asked Sep 28 '11 13:09

David Gard


1 Answers

I was searching for this too and found this

<!-- 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(); place this code and the button will appear

like image 52
Hovhannes Avatar answered Oct 22 '22 10:10

Hovhannes