Re: html code in <script>

Lachlan Hunt wrote:
> 
> In general, it's a bad idea to teach people to use HTML comments within 
> scripts these days because it's completely unnecessary and if and when 

However, as written, the original question seemed to be about providing 
exactly that sort of backward compatibility, even if the reality was 
that they were confusing the validator's rejecting of bad XHTML with it 
not understanding scripts - it understands script elements, but doesn't 
interpret the scripts; the real problem was that they never tested with 
a proper XHTML browser.

> authors try to use XHTML, it's yet another habbit they'll be forced to 
> break or otherwise their scripts will be commented out.

When they use XHTML, they will have to use CDATA!

Although I'm not personally aware of any set top boxes that don't 
understand script elements, any new features in HTML really need to be 
backwards compatible with viewers that are this old as set top boxes are 
likely to last 15 to 20 years in the hands of middle-aged to elderly 
users and software maintenance is likely to die off after the first 
couple of years.  I have a set top box that is no longer getting any 
firmware updates other than channel logos and sponsored starting point 
URLs.  Fortunately I don't use it for normal web access.
> 

As it happens they have changed the page such that it disenfranchises 
many older scripting capable browsers, and, I suspect, some set top 
boxes, although I've not tried it on mine.  Browsers excluded include 
versions of Netscape before Netscape 4(?) and several versions of IE. I 
haven't checked it on my set top box.  (They should have feature tested 
DOM 1 features before using them, otherwise they risk scripting error 
alerts.  There was still no reason for using XHTML.)

They have used a comment hack, but the // one to support Appendix C 
mode, not the <-- one to support pre-script element browsers.

-- 
David Woolley
Emails are not formal business letters, whatever businesses may want.
RFC1855 says there should be an address here, but, in a world of spam,
that is no longer good advice, as archive address hiding may not work.

Received on Thursday, 15 November 2007 08:13:08 UTC