Iframe Like button doesn't launch edge.create

I do not want to use xfbml. I need to use iframe as a button as shown below. But this does not fire edge.create .

 <div id="fb-root"></div> <script src="http://connect.facebook.net/en_US/all.js"></script> <script> // initalize your Facebook App FB.init({ appId : '113869198637480', status : true, // check login status cookie : true, // enable cookies to allow the server to access the session xfbml : true // parse XFBML }); // subscribe to the event FB.Event.subscribe('edge.create', function(response) { alert('you liked this'); }); FB.Event.subscribe('edge.remove', function(response) { alert('you unliked this'); }); </script> <iframe id="test" src="http://www.facebook.com/plugins/like.php? href=http://google.com/&amp; layout=button_count&amp; show_faces=false&amp; width=50&amp; action=like&amp; colorscheme=light&amp; height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:50px; height:21px;" allowTransparency="true"> 
+8
facebook iframe facebook-like
source share
1 answer

This is quite expected; javascript callbacks are only available when using the Javascript version of social plugins, including the Like Like button.

This is mentioned in the Like Button documentation:

 How do I know when a user clicks a Like button? If you are using the XFBML version of the button, you can subscribe to the 'edge.create' event through FB.Event.subscribe. 

When you enable the Like button as an iFrame directly, there is no way to distribute the event on the Facebook servers to your javascript code - the Javascript SDK for Facebook processes this message when using the XFBML version of the Favorites button

+8
source share

All Articles