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

Re: document.write

From: Herr Christian Wolfgang Hujer <Christian.Hujer@itcqis.com>
Date: Tue, 1 Apr 2003 00:20:51 +0200
To: Matt Fletcher <msfy2k@yahoo.co.uk>, www-html@w3.org
Message-Id: <200304010020.54398.Christian.Hujer@itcqis.com>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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.


Bye
- --
ITCQIS GmbH
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/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE+iL9Fzu6h7O/MKZkRAmugAKDV1rjdCJayoBfkS3Dsm081lMxCnACfemG8
/HYPh3bpuGxwYHwmwGG2zbE=
=cyDQ
-----END PGP SIGNATURE-----


Received on Wednesday, 2 April 2003 18:59:04 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 March 2012 18:15:54 GMT