This code is totally from FB Development tutorial. In my html file:
<script>
window.fbAsyncInit = function() {
FB.init({
appId : 'APP_ID', // App ID
channelUrl : '//WWW.localhost:3000//channel.html', // Channel File
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
})};
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/ru_RU/all.js#xfbml=1&appId=APP_ID";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
FB.Event.subscribe('edge.create',
function(response) {
alert('You liked the URL: ' + response);
}
);
</script>
As it is written in tutorial, Event subscribe should invoke alert each time button is clicked, but nothings happens. Basically, I want to start AJAX put each time button clicked and count likes