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

On Mon, 07 Aug 2006 13:04:23 +0700, Alexey Feldgendler <alexey at feldgendler.ru> 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.

> It's not that bad. It only depends on the open/closed state of the document,
> which is kept somewhere anyway. A call to document.close() or an
> end-of-stream closes a document.

Please disregard my last message.

But, anyway, I'm strongly against prohibiting event handling while the document is loading. Doing that would be removing functionality on which existing documents rely.


-- 
Alexey Feldgendler <alexey at feldgendler.ru>
[ICQ: 115226275] http://feldgendler.livejournal.com

Received on Sunday, 6 August 2006 23:08:17 UTC