Trigger javascript function when facebook comment left [duplicate]
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.
精彩评论