开发者

Trigger javascript function when facebook comment left [duplicate]

开发者 https://www.devze.com 2023-04-06 16:46 出处:网络
This question already has an answer here: Closed 11 years ago. Possible Duplicate: Facebook like c开发者_如何学运维allback, and post it to target to like
This question already has an answer here: Closed 11 years ago.

Possible Duplicate:

Facebook like c开发者_如何学运维allback, and post it to target to like

I'm trying to find a way to run a javascript function when someone leaves a comment on something in my facebook app via the comment pluggin. Is there any way I detect the event. Would also like to a the same when some clicks the "Like" button.

Any Ideas?


Here is how : http://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/


You can use the FB.Event.subscribe function. http://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/

FB.Event.subscribe('comments.add', function (response) {
    // do something with response
});

I haven't tried this out myself, but I've read you should add the notify="true" attribute to the fb:comments tag for it to work.

0

精彩评论

暂无评论...
验证码 换一张
取 消