According to FB.Event.subscribe , a download event appears that will be fired automatically when the page finishes rendering the plugins
Step-1: In HTML (put where you want to show the social box):
<div class="fb-page" data-href="https://www.facebook.com/facebook" data-small-header="true" data-adapt-container-width="true" data-hide-cover="false" data-show-facepile="true"><div class="fb-xfbml-parse-ignore"><blockquote cite="https://www.facebook.com/facebook"><a href="https://www.facebook.com/facebook">Facebook</a></blockquote></div></div>
Step-2: In the footer (just before the end of the <body> ):
<div id="fb-root"></div> <script> window.fbAsyncInit = function(){ //FB.init({ status: false, cookie: true, xfbml: true }); FB.Event.subscribe("xfbml.render", function(){ SocialBoxesLoaded(); //-->this is what we want (any custom Function) :) }); }; (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/en_US/sdk.js#xfbml=1&version=v2.8"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk')); function SocialBoxesLoaded(){ //...Your Custom Code... } </script>
source share