XHTML CDATA and comment tags (was: Re: [thelist] different ways of importing css + tip)

Bill Mason evolt at accessibleinter.net
Wed Nov 13 12:38:07 CST 2002

At 10:05 AM 11/13/2002, Ben Dyer wrote:
>You can use both properly by doing the following:
><script language="JavaScript" type="text/javascript">
><!-- <![CDATA[
>    // Whatever.
>// ]]> -->

That may *work* in current browsers, but I would hardly call it proper. If
you serve XHTML as an XML mime type, a correct XML user agent will obey the
comment tags and ignore the entire script.

Bill Mason
Accessible Internet
evolt at accessibleinter.net

More information about the thelist mailing list