I am looking for the same solution.
The details are I am fetching a file via ajax, much as you would an iframe. The file opens in an 'ajaxwin' window layer above the parent dhtml document (floating div essentially).
document.write("My name is John")
That output will not shown up when it's included on the main page via Ajax, as this is a runtime operation, which Ajax isn't (it's asynchronous or dynamic).