RE: XHTML's reception

> At 12:21 2001-06-25 +0200, Clover Andrew wrote:
> >On a non-political practical note, how about:
> >
> >   <script type="text/javascript"><!-- // --><![CDATA[
> >     ...
> >   //]]></script>
> >

And Christian Ottosson wrote:
> Would even
> 
>    <script type="text/javascript">//<![CDATA[
>      ...
>    //]]></script>
> 
> be enough and specs following (with the same aesthetical 
> reservations)?

However neither are quite right. Whilst they both deal admirably with
commenting out the CDATA tags from scripting browers, only Clover's attempts
to also comment out the contents of the script tags from non-scripting
browsers (as per http://www.w3.org/TR/html4/interact/scripts.html#h-18.3.2),
however he omits the --> ending that (i think i'm right in saying) browsers
like IE2 require (of course if they just key off the next '>' - using the
]]> to be precise, then Clover's is fine).

To keep these elderly browsers happy, what you really want is:
   <script type="text/javascript"><!-- //<![CDATA[
     ...
   //]]>--></script>

But that then comments out the CDATA bit for the XML parsers... Hmm, messy.

Received on Tuesday, 26 June 2001 07:42:21 UTC