- From: Jukka K. Korpela <jkorpela@cs.tut.fi>
- Date: Fri, 31 Dec 2004 13:50:33 +0200 (EET)
- To: bbarak@uwo.ca
- Cc: www-validator@w3.org
On Wed, 29 Dec 2004 bbarak@uwo.ca wrote: > However, this occurs in a location.href which occurs in a <script > type="text/javascript"></script> code region. The validator should NOT be > looking for & within JavaScript because & is translated into & in HTML, > not in JavaScript. No, a validator _must_ process an HTML document according to the formal rules, and the <script> element _is_ part of the HTML document, and the mode of processing its content is defined by the document type definition. You are apparently using XHTML, and in XHTML, the content model for <script> is #PCDATA, which means that entity references must be recognized. The simple solution is to write your JavaScript code into an external file foo.js and refer to it via <script type="text/javascript" src="foo.js"></script> -- Jukka "Yucca" Korpela, http://www.cs.tut.fi/~jkorpela/
Received on Friday, 31 December 2004 11:51:06 UTC