Re: noscript and script without a line return

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 UTC