[Javascript] innerHTML in xhtml (was: document.all for NETSCAPE)

liorean liorean at gmail.com
Wed Oct 13 08:08:19 CDT 2004


On Wed, 13 Oct 2004 14:13:22 +0200, Peter-Paul Koch <pp.koch at gmail.com> wrote:
> Sure, sure. But how do I change the page so that it works in Mozilla while still being application/xhtml+xml? I just want to test whether innerHTML works or not.

This was answered by the following:

> > Thus, if the document does not use the XHTML1 namespace, it won't be treated as XHTML1. And you must use the namespace in all XHTML documents anyway, it's required by the DTD

IOW, you need the XHTML1 namespace for the browsers to know to apply
XHTML semantics to the element tree, including such things as style
sheet and scripting association, but also default styling, linking
semantics, forms and form controls semantics and the like.

A minimal XHTML1 document structure would be:
1. Recommended, and a must if you use non-unicode encodings: XML
declaration <?xml ... ?>
2. Recommended: Style sheets should use the xml-stylesheet PI if
served as 'application/xhtml+xml'. However, since MSN/OSX as the
single 'application/xhtml+xml' user agent that doesn't have XML
support as a direct effect doesn't support the xml-stylesheet PI
either, using the XHTML link or style elements instead in
'application/xhtml+xml' served documents may be acceptable.
3. Recommended but not required: DOCTYPE declaration. Note that the
DTD specified by the DOCTYPE declaration is not responsible for
semantics.
4. Required: The minimal valid XHTML1 element tree:
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title/>
    </head>
    <body>
    <%Block;/>
    </body>
    </html>
-- 
David "liorean" Andersson
<uri:http://liorean.web-graphics.com/>



More information about the Javascript mailing list