[whatwg] What should document.write() do when called from setTimeout or event handlers?

Ian Hickson ian at hixie.ch
Sat Aug 5 16:38:58 PDT 2006


On Tue, 1 Aug 2006, Alexey Feldgendler wrote:
>
> On Tue, 01 Aug 2006 05:34:55 +0700, Ian Hickson <ian at hixie.ch> wrote:
> 
> > IE seems to make those calls to document.write() simply blow away the
> > document, as if the document was closed. Opera seems to do the same.
> 
> I think this is the best thing to do. Easy to implement and well-defined.

It's not particularly well-defined, since you have to now make a 
distinction between scripts that are executing "inline", and scripts that 
were started by scripts executing inline but are actually executing in a 
different context. It basically means that the behaviour of 
document.write() depends on more than the current state of the browser, it 
depends on the call stack of the script executing. That's quite weird.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'



More information about the whatwg mailing list