So I'm trying to do some event handling when a user clicks the like button.
My Facebook button is being created asynchronously via:
(function() {
var e = document.createElement('script'); e.async = true;
e.src = document.location.protocol +
'//connect.facebook.net/en_US/all.js';
document.getElementById('fb-root').appendChild(e);
}());
And that works great.
I have the following function running as well:
window.fbAsyncInit = function() {
FB.init({status: true, cookie: true, xfbml: true});
FB.Event.subscribe("xfbml.render", function() {
console.log('xfbml.render');
FB.Event.subscribe("edge.create", function(targetUrl) {
console.log('edge.create');
});
FB.Event.subscribe("edge.remove", function(targetUrl) {
console.log('edge.remove');
});
});
};
So far, when I load the page, I get 'xfbml.render' in the console. Then I click the like button & I get nothing.
I'd like for it to spit out the console message 'edge.create'.
Does anyone have any idea what could cause this?
I've put this page on a publicly accessible site before (It's currently on my dev rig) & it still didn't work. I can again if requested.