Overwriting iframe's document.write
For my own purposes ( cough lazy-loading an ad script), I am overwriting the document.write function in order to buffer the script's output, writing it to a div, and restoring the native document.write when I am done. The pseudo-code looks something like this: save off native code document.write redefine document.write eval and buffer output of script when script is done, write buffer to restore native document.write The problem happens in the bolded step - one of the lines in the ad script creates an iframe, and calls frame.document.write Stepping through Firebug, I have verified that this