W3C home > Mailing lists > Public > www-html@w3.org > April 2003

Re: document.write

From: Herr Christian Wolfgang Hujer <Christian.Hujer@itcqis.com>
Date: Wed, 2 Apr 2003 22:06:34 +0200
To: Matt Fletcher <msfy2k@yahoo.co.uk>, www-html@w3.org
Message-Id: <200304022206.36204.Christian.Hujer@itcqis.com>
Hash: SHA1

[Note for duplicate mail:
Zahlreiche Mails müssen nun ein zweites Mal gesendet werden. Sorry für 
Many mails must be sent a second time. Sorry for duplicates.]

Hello Matt, dear list members,

Am Freitag, 28. März 2003 12:05 schrieb Matt Fletcher:
> The XHTML 2 spec says that you can't use
> document.write() to create content for a page,
> and mentions the node tree (or something like
> that). How exactly does that work? Is it
> currently implemented? Or is it coding using the
> InnerText properties? Please enlighten me!

Take a look at http://www.w3.org/TR/DOM-Level-2-Core/ that's about the DOM
node tree and ways for its manipulation.

document.write() should not work for any XHTML at all, as long as the user
agent recognizes that the document is XHTML and not HTML. So the only
exception is XHTML 1.0 served as text/html.

innerText / innerHTML is very bad design, I recommend not to use it.

If you want to experiment with XHTML, try Mozilla, Konqueror (from KDE 3.1 or
newer) or Opera (6 or 7) and be sure to let your documents end on .xhtml
(when working locally) resp. send them as application/xhtml+xml (when working
remotely through HTTP).

I have attached an example using XHTML, ECMAScript and DOM to automatically
generate a table of contents including anchors, hyperreferences and links.
It also contains some dynamic parts.

The document is known to work in Mozilla 1.3. I know it doesn't work with
Konqueror 3.1 because Konqueror 3.1 doesn't handle the onload-attribtue of
the body element. Only the dynamic rect part works in konqueror.

- --
Christian Wolfgang Hujer
Geschäftsführender Gesellschafter
Telefon: +49  (0)89  27 37 04 37
Telefax: +49  (0)89  27 37 04 39
E-Mail: Christian.Hujer@itcqis.com
WWW: http://www.itcqis.com/

Version: GnuPG v1.0.7 (GNU/Linux)


Received on Wednesday, 2 April 2003 15:07:57 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:06:03 UTC