This is mostly aimed at Kevin, our resident expert in html and js in the wild,
but I thought I'd post it here for all to consider.
A pivotal question influencing design is this.
Is document.write immediate and atomic?
I asked before and Kevin thought it was.
That as soon as I see document.write(string) I am to parse that html
and create the implied js objects etc etc.
And yet, I'm pretty sure I've seen websites,
I know I've written websites, wherein the write is not atomic,
and should not be parsed in isolation.
Example:

document.write("<P><a href=url>");
document.write("click on this baby");
document.write("</a>");

I'm pretty sure I've seen things like that, what do others say?
Parsing each string as an individual html document would not work.
The first string would degenerate to <a href=url></a>,
and the second would just be text not enclosed in a hyperlink,
and the third would be a close tag without an open tag and discarded.
That won't work.
If document.writes are as above,
then my current design is correct and should not change.
Build the writes up in a buffer and then parse the write buffer
after the script returns.
This is completely separate from the innerHTML strategy,
foo.innerHTML = string;
The string is the whole html in its entirety,
is to be parsed at this time,
and the js objects immediately available by the next line of javascript.
I just don't think document.write works that way,
but I have to suspend all coding until I have a confident answer to this 
question.

Karl Dahlke
_______________________________________________
Edbrowse-dev mailing list
[email protected]
http://lists.the-brannons.com/mailman/listinfo/edbrowse-dev

Reply via email to