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

前端 未结 5 1495
既然无缘
既然无缘 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:51

    Make a PHP (or whatever language you use) script to CURL the source from http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.MySite.Com... blahblahblah

    Put the source from facebook into your html page, you can then you can do whatever you like in JavaScript/jQuery with the code from Facebook.

    Some examples for CURL within PHP - http://www.php.net/manual/en/curl.examples.php

提交回复
热议问题