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

浪尽此生 提交于 2019-11-30 09:05:24
Hovhannes

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

If you're trying to render a person badge with ajax rather than a plusone you need a different api call: api.person.go(); https://developers.google.com/+/web/badge/#gapi.*.go

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!