Jean Pierre Daviau wrote:
[color=blue]
> Hi,
>
> <script language="javascript" type="text/javascript">
> if(navigator.appName.indexOf("Netscape") != -1){
> document.writeln('<link rel="stylesheet" href="~styles/aquarelle_ns.css"
> type="text/css" media="screen" title="base" />');
> }else{
> document.write('<link rel="stylesheet" href="~styles/aquarelle.css"
> type="text/css" media="screen" title="base" />');
> }
> </script>
>
> <style type="text/css">
> ...
> </style>
> </head>
> ------------------------------------
> [snip][/color]
The most important issue: document.writeln() does not work in XHTML, if it's
served as application/xhtml+xml. I assume that you are going to do this (at
least with content negotiation, for browsers that support it), because
XHTML is just another form of tagsoup, if served as text/html.
Script snippets that contain '<' or '&' characters must be enclosed in
<[CDATA[ .. ]]> marked sections, otherwise the validator will not parse the
document as you intend it to do (browsers are more tolerant, but I would
not count on it).
This does not happen, if you stick to HTML, because the STYLE element has
the content model CDATA, which means that the parser ignores (e.g. does not
interpret a '<' as the start of a tag) everything until it finds the first
'</' followed by a character 'a..z' or 'A..Z'.
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW:
http://www.odahoda.de/