문제

Is there a way to catch event of clicking fb Like button ? I don't want to integrate my app with facebook, just need to count clicks of 'Like' . Tried :

$('.fb_iframe_widget').click(function(){
    alert("clicked");
});

but without any luck. If there is no way of doing this will I be able to count likes of particular pages when synced with FB API ?

도움이 되었습니까?

해결책

You must use the xfbml like button rather than the iframe button. After you switch that, do the following:

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

The facebook event "edge.create" is called when a like button is clicked. I have no idea why it is named that, but that will do what you are looking for.

다른 팁

If that doesn't work, then I think you'd be out of luck, as you can't do anything else because of same origin policy.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top