JavaScript validation issues

Hi all -

I've been wrestling with a JavaScript error from the validator for a few 
days for the following code. I've tried escaping the JavaScript with 
backslashes and commenting but that still doesn't stop the validator from 
assuming it's HTML:

<script type="text/javascript">

             var wtl_loc = 

             document.write("<SCR" + "IPT Language = 'JavaScript' SRC = '" 
+ wtl_loc + "'></SCR" + "IPT>");


Validator sez:

Line 23, column 32: an attribute specification must start with a name or 
name token

document.write("<SCR" + "IPT SRC = '" + wtl_

Check for stray quotes or incomplete attribute definitions.

Line 23, column 32: element "SCR" undefined

document.write("<SCR" + "IPT Language = 'JavaScript' SRC = '" + wtl_

You have used the element named above in your document, but the document 
type you are using does not define an element of that name. This error is 
often caused by incorrect use of the "Strict" document type with a document 
that uses frames (e.g. you must use the "Frameset" document type to get the 
"<frameset>" element), or by using vendor proprietary extensions such as 
"<spacer>" or "<marquee>" (this is usually fixed by using CSS to achieve 
the desired effect instead).

Line 23, column 94: delimiter """ invalid: only S separators and TAGC 
allowed here

...Script' SRC = '" + wtl_loc + "'></SCR" + "IPT>");

Thanks in advance for any suggestions. I'm wondering if I've just been 
staring at the code for too long.

B.K. DeLong
+1.617.797.2472                       Work.               Play.        Potter.               Sigil.          Future.                         Security.           Son.

PGP Fingerprint:
38D4 D4D4 5819 8667 DFD5  A62D AF61 15FF 297D 67FE


Received on Thursday, 9 December 2004 15:06:22 UTC