Show warning on button click

I use the default embed code for Facebook:

<div id="fb-root"></div> 
<script src="http://connect.facebook.net/en_US/all.js#appId=176702405718664&amp;xfbml=1"> </script>
<fb:like href="http://domain.com" send="true" width="700" show_faces="false" action="recommend" font=""></fb:like>

.. but I would like to show a warning if the user clicks the Recommend or Submit buttons. Check out this script:

http://jsfiddle.net/4wB9x/1/

Thank!

+5
source share
1 answer

you will need to subscribe to the edge.create event, it fires when the user clicks the type button.

FB.Event.subscribe('edge.create',
function(response) {
    alert('You liked the URL: ' + response);
   }
);

// you will have to use this to send

 FB.Event.subscribe('message.send',
function(response) {
    alert('You sent the URL: ' + response);
   }
); 
+5
source

All Articles