Attach a click() event to the google plus button?

前端 未结 2 1727
情深已故
情深已故 2021-01-14 00:54

I\'d like to add a alert message on the page when a user clicks \'g+\' button. how can i achieve this ?
here is code :



        
2条回答
  •  余生分开走
    2021-01-14 01:24

    Just incase you want some code to get you started, the following markup will enable the interaction events in a +1 button:

    The following code will handle the events:

    function onStarted(args){
      console.log("started");
      console.log(args);
    }
    function onEnded(args){
      console.log("ended");
      console.log(args);
    }
    function onCallback(args){
      console.log("callback");
      console.log(args);
    }
    

    The callback will return the +1 state of the button, start/end interaction indicates the user state. You can see a demo of all the events here.

提交回复
热议问题