开发者

Trigger javascript function when facebook comment left [duplicate]

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜