Re: Validator confused with the character "<" and inline javascript

2012-03-20 22:42, Jvblaha@aol.com wrote:

> NOTE: Whenever possible, give the address of the document you were
> checking.

The idea is that when submitting a problem report, you should follow 
this advice, not quote it.

> Here are the validator messages.
>
> 1. /Line 1193, Column11: character "<" is the first character of a
> delimiter but occurred as data/
>
> while (i *<*requestCnt) {

Apparently you are using an XHTML doctype and this appears inside a 
<script> element. In XHTML, any occurrence of "<" inside the element 
must be escaped as &lt;, unless you use the CDATA technique suggested at
http://www.w3.org/TR/xhtml1/diffs.html#h-4.8
(Using CDATA is preferable, since you are most probably serving XHTML as 
HTML, and &lt; may therefore cause problems. The best option is to use 
an external JavaScript file.)

> By putting the javascript in a separate file, at least the error doesn't
> show up in Validator,

Indeed, because the separate file will not be read at all by the validator.

Administrativia: The message had been posted March 20th but I got it 
today, March 24th. According to message headers, it was received by a 
server at w3.org the day it was sent but sent forward to another w3.org 
server days later:

Received: from maggie.w3.org ([128.30.52.39])
 by frink.w3.org with esmtp (Exim 4.69)
 (envelope-from <Jvblaha@aol.com>)
 id 1SA5tY-0005UY-U1
 for www-validator@listhub.w3.org; Tue, 20 Mar 2012 20:43:04 +0000
Received: from imr-db01.mx.aol.com ([205.188.91.95])
 by maggie.w3.org with esmtp (Exim 4.72)
 (envelope-from <Jvblaha@aol.com>)
 id 1SA5tT-0000ba-Jh

I think there have been a few such incidents recently.

Yucca

Received on Saturday, 24 March 2012 06:37:27 UTC