W3C home > Mailing lists > Public > www-validator@w3.org > February 2010

Re: HTML4 + <script><![CDATA[ </ENDTAG> ]]></script>

From: David Dorward <david@dorward.me.uk>
Date: Fri, 5 Feb 2010 07:25:51 +0000
Cc: www-validator@w3.org
Message-Id: <C0205A3B-CAFB-4AE1-AEA5-CF68B42D1204@dorward.me.uk>
To: Leif Halvard Silli <xn--mlform-iua@xn--mlform-iua.no>

On 5 Feb 2010, at 03:56, Leif Halvard Silli wrote:

> David Dorward, Mon, 1 Feb 2010 10:51:16 +0000:
> 
>> ... or you could just use a JS comment rather than depending on hacks 
>> designed to avoid having Netscape 2 and friends render JS as text 
>> (which would break if the script was placed in an external file).
> 
> The Netscape hack comes in handy, to save HTML4 from itself! The two 
> examples below validates both as XHTML and HTML4 - and at the same time 
> they eliminate the need for end tag escaping in HTML4. 


It is hideous.

1. From an aesthetic point of view, it is just an ugly mass of code

2. It depends on browsers implementing HTML 4.01 incorrectly in order to work

3. It throws warnings in the validator

4. It stops being valid HTML 4.01 as soon as the script contains the sequence --

e.g. for (var i = foo.length - 1; i >= 0; i--) {

-- 
David Dorward
http://dorward.me.uk
Received on Friday, 5 February 2010 07:26:36 GMT

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