As you probably know the Facebook Like button loads very slowly.
And I am trying to figure out how to detect when the button has finished loading and has been added to the website.
The reason being that I show a loading animation, and then hide that and show the button, but I'd like to show the button when it has finished loading.
Can this be done?
Thanks in advance everyone!
The like button is a feature of social networking service Facebook, where users can like content such as status updates, comments, photos and videos, links shared by friends, and advertisements. The feature was activated February 9, 2009.
In 2009, Facebook introduced the Like button. The tiny thumbs-up symbol, a simple indicator of people's preferences, became one of the social network's most important features. The company allowed other websites to adopt the Like button so users could share their interests back to their Facebook profiles.
Go to Settings › General, then click the Share tab. Enable the Facebook Like/Recommend button setting by clicking the “thumb up” Like icon. Then click the settings (...) icon in the upper left of the button.
Facebook announced it is “removing 'Likes' and focusing on 'Followers' to simplify the way people connect with their favorite Pages.
One can subscribe to the xfbml.render event to get notified when rendering is complete, which only fires once per page parsing (and works not only for xfbml, but for the new html5 trickery too). Page parsing automatically happens when the FB JS SDK loads if xfbml : true
.
window.fbAsyncInit = function() {
FB.init({
...
xfbml : true
});
FB.Event.subscribe('xfbml.render', function(response) {
alert('OMG... All Facebook sociaal plugins on page rendereed.... finally!');
});
};
// And load the SDK Asynchronously here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With