This example dynamically creates an iframe and assigns a function to its window object's onload event handler.
This works in all browsers so long as the iframe just loads a local resource. There's a JavaScript error when you attempt this for foreign resources.
Back to the blog post