I have a facebook button on my site (implemented through XFBML and their JS SDK), and I need to dynamically position it based on it’s size (I have to find out it’s width / height).
The problem is, window.load doesn’t work for this because the button is loaded asynchronously (I think this is the reason). The button ends up in the wrong place because of this (JS gets the height / width at the wrong stage of it’s rendering).
How do I go about calling a function only after the facebook button is rendered?
There is
xfbml.rendewhich is called after widget is rendered: http://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/