Attach a click() event to the FaceBook 'Like' button?

前端 未结 5 1472
既然无缘
既然无缘 2020-12-25 14:27

I\'d like to do something on the page when a user clicks \'Like\'.

I thought something simple like the following would work:



        
5条回答
  •  礼貌的吻别
    2020-12-25 14:37

    Facebook API doesn't allows you to subscribe to the like clicking event, but it allows you to subscribe to the like happening event (fired when the like action is completed):

    FB.Event.subscribe('edge.create', function(response) {
      // like clicked
    });
    

    see here.

提交回复
热议问题