This page demonstrates how to dynamically load a Flickr badge using writeCapture.js.

Why do you need a library to load a Flickr badge? Because the Flickr Badge script uses the most evil of JavaScript methods: document.write, which will wipe out the entire page if loaded dynamically. Don't believe me? Go ahead and try the link below, and see how it opens up a nice dialog and dynamically loads the HTML containing the Flickr Badge.

Show photos

Now try this page without writeCapture.js. Loading the badge wipes out everything in the document, leaving you with just the images. Not much fun, is it?

If you view the source, you'll see there is only one small difference between the version using writeCapture, and the one without:

			
dialog = dialog.writeCapture();

Chaining HTML manipulation methods off of writeCapture() makes them safe. The whole library is less than 3k compressed and has been extensively tested to cover all possible edge cases, so there is really no reason not to use it. Enjoy!

Home