Google Plus One Button - How to add a callback?

后端 未结 2 1824
广开言路
广开言路 2021-01-04 22:50

I have the google+ button being rendered on my site as follows:

In the JS:

    var po = document.createElement(\'script\'); po.type = \'text/javascr         


        
2条回答
  •  耶瑟儿~
    2021-01-04 23:32

    You can add a JavaScript callback using a callback attribute to your +1 button markup. Supply the name of a function that resides in the global namespace. It will be called when a user clicks on the +1 button.

    Here's what your code might look like:

    
    
    
    

    You can learn more about this attribute in the tag parameters section of the documentation.

提交回复
热议问题