W3C home > Mailing lists > Public > html-tidy@w3.org > October to December 2002

RE: HTML-KIT 292 TIDY problem with JavaScript code

From: Richard Norman <normri@samc.com>
Date: Fri, 06 Dec 2002 16:57:01 -0800
Message-Id: <sdf0d6de.015@samc.com>
To: <html-tidy@w3.org>

In regards to this question,  is it good HTML practice to escape all
your script tags with a CDATA markers?
I started doing my script tags like the following
<script language="JavaScript" type="text/javascript">
If this is incorrect, please let me know.  I was in the process of
trying to conform more to the standards and I read somewhere that you
should escape your Script sections with the CDATA directive.  Below I am
showing the doctype I used...
 "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns=" HYPERLINK
xml:lang="en" lang="en">
Richard Norman
P.S. When I sent the file to the validator, it ended up passing as

-----Original Message-----
From: "Dave Cannarella" <dave.cannarella@horizonair.com> 
Sent: Friday, December 06, 2002 4:20 PM
To: <html-tidy@w3.org>
Subject: HTML-KIT 292 TIDY problem with JavaScript code

I just downloaded HTML_KIT build 292 and have some TIDY problems that
did not 
occur in build 290. I received error and warning messages in JavaScript
that is being interpreted as HTML. Do you have any suggestions? Below is
<!DOCTYPE HTML PUBLIC "_//W3C//DTD HTML 4.01 Transitional//EN"> 
<title>Sierra Club Loowit Group Get Outdoors</title> 
<script language="JavaScript" type="text/javascript"> 
function MM_preloadImages() { //v3.0 
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); 
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length;
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}} 
function MM_findObj(n, d) { //v4.01 
var p,i,x; if(!d) d=document;
if((p=n.indexOf("?"))>0&&parent.frames.length) { 
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} 
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) 
if(!x && d.getElementById) x=d.getElementById(n); return x; 
<body bgcolor="#FFFFFF" text="#000000"> 
Hello world 
Below are errors and warnings: 
'<' + '/' + letter not allowed here 
unescaped & which should be written as &amp; 
unescaped & or unknown entity "&parent.frames.length" 
unescaped & or unknown entity "&i" 

Incoming mail is certified Virus Free. 
Checked by AVG anti-virus system ( HYPERLINK "http://www.grisoft.com"
Version: 6.0.423 / Virus Database: 238 - Release Date: 11/25/2002 

Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.423 / Virus Database: 238 - Release Date: 11/25/2002

The contents of this email and any attachments are confidential.
It is intended for the named recipient(s) only.
If you have received this email in error please notify the system manager or  the 
sender immediately and do not disclose the contents to any one or make copies.

Received on Friday, 6 December 2002 19:58:08 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:38:52 UTC