W3C home > Mailing lists > Public > www-validator@w3.org > September 2006

Re: noscript and script without a line return

From: David Dorward <david@dorward.me.uk>
Date: Tue, 5 Sep 2006 13:38:06 +0100
To: Tig <tigger@lvlworld.com>
Cc: www-validator@w3.org
Message-ID: <20060905123806.GD18446@us-lot.org>

On Tue, Sep 05, 2006 at 10:37:26PM +1000, Tig wrote:
> Thank you for your reply. I've now change the XHTML samples above to the
> following, which now validate.
> 
> <script language="javascript" type="text/javascript">
> //<![CDATA[

> But is that correct? Including //<![CDATA[  and //]]> seems like a hack
> to get around the validator.

Marking it as CDATA is quite correct. The hack is the JavaScript
comments to hide it from HTML parsers. XHTML as text/html is a hack.

Also, as I think was noted elsewhere, document.write doesn't play well
with current XHTML user agents which renders you code as useful only
as text/html (and so you might as well be using the better supported
HTML 4.01 anyway).

-- 
David Dorward                                      http://dorward.me.uk
Received on Tuesday, 5 September 2006 12:38:15 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 April 2012 12:14:22 GMT