facebookfbml

FBML elements rendering delay


I am using FBML for rendering certain elements on the page such as the name of the user, profil pic, etc. However when there are many FBML elements on page, there is a slight delay which occurs before they are rendered - that's fine since AJAX calls are made to the server to fetch the data by the JS FB library. However, I want to hide the container DIV holding these element till the elements have finished loading, so is there any way to specify a JS callback function which gets fired when the FBML data has finished loading?


Solution

  • Try FB.Event.subscribe

    FB.Event.subscribe('xfbml.render', function(response) {
      //xfbml.render is fired when a call to FB.XFBML.parse() completes
    });