blog.eliotsykes.com

Icon

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:

http://stackoverflow.com/questions/2117691/using-prototype-to-load-a-javascript-file-from-another-domain/2123219

Many thanks to Thomas’s answer which pointed me in the right direction.

Category: Uncategorized

Tagged:

Leave a Reply

Who’s Blog?



Hello, I’m Eliot Sykes and this is my blog. Thank you for visiting. I'm the Founder of MissedConnections.com


Read about my current projects, contact me or find me on github