I tried to implement the Like button along with some code fired on liking the page, but I’m unable to get it working.
When I like the page FIrebug shows this error:
Event.__inlineSubmit is not a function
and nothing happens (ie no alert / redirection / whatever) besides the page being liked by me. The code so far:
<div id="fb-root"></div>
<script type="text/javascript">
<!--
window.fbAsyncInit = function () {
FB.init({ appId: '---MYAPPID---', status: true, cookie: true, xfbml: true });
FB.Event.subscribe('edge.create', function (href, widget) {
// track the click on the "Like" button here
alert(href);
});
};
(function () {
var e = document.createElement('script');
e.type = 'text/javascript';
e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
e.async = true;
document.getElementById('fb-root').appendChild(e);
} ());
//-->
</script>
<div class="fb-like" data-send="false" data-layout="box_count" data-width="60" data-show-faces="false"></div>
http://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/