Re: Error in validator

Charles Saeger <rasputin@visi.com> wrote:

> On my title page, I have a counter JavaScript triggered by a cookie.  When
> I run the validator, I get this for an error:
> 
> Error at line 153:   you have visited this page "+ hitCt + " times?</em>")
>                  end tag for element "EM" which is not open
> (explanation...)
> 
> There's a problem, of course.  I did open an <EM> tag earlier in the same
> line:
> 
> 153: 	document.write("<em>Does your mother know that you have visited
> this page "+ hitCt + " times?</em>")

Take a look at "B.3.2 Specifying non-HTML data" in HTML 4.0
Specification [1].  You have to use "<\/em>" instead of "</em>"
inside the SCRIPT element.

[1] http://www.w3.org/TR/REC-html40/appendix/notes.html#notes-specifying-data

Regards,
-- 
Masayasu Ishikawa / mimasa@w3.org
W3C - World Wide Web Consortium

Received on Thursday, 29 July 1999 12:10:29 UTC