Jan 23, 2010
Using Prototype to load Facebook API on demand (or any other script)
I was trying to figure out how to get PrototypeJS to load the Facebook JavaScript API on demand.
For Missed Connections I’m writing a modal box that can optionally display a Facebook connect button, but I didn’t want to load the Facebook API unless the Fb connect button is shown.
In the end I wrote FacebookApiLoader to do this, you can find the source and details here:
Many thanks to Thomas’s answer which pointed me in the right direction.