W3C home > Mailing lists > Public > www-validator@w3.org > January 2011

Re: No error for improperly closed <script> tag

From: Jukka K. Korpela <jkorpela@cs.tut.fi>
Date: Thu, 13 Jan 2011 22:33:23 +0200
Message-ID: <049EB9EDC3B1473293D6D6991EB32A74@JukanPC>
To: "Schneider, Cody" <Cody.Schneider@fisglobal.com>, <www-validator@w3.org>
Schneider, Cody wrote:

> Wrong: <script type="text/javascript" src="script.js
> <https://cibng.ibanking-services.com/cib/CEBMainServlet/SplashPageScript
> ?FIORG=592&amp;FIFID=091901215> "/>
> This may be valid XHTML

It is, therefore a proper validator must not report it as an error. It is 
debatable whether it could and should issue a warning.

> but caused pages to not display at all in
> Firefox and IE

This really depends on how the document is served, on the Content-Type in 
HTTP headers.

If served as text/html, browsers treat <script ... /> as if the "/" were not 
there - so the rest of the document is taken as being inside the script 

If served with an XHTML document type, IE can't handle it at all, whereas 
Firefox processes it by XHTML rules, treating <script ... /> as <script ... 
 ></script> and the document works as expected.

Yucca, http://www.cs.tut.fi/~jkorpela/ 
Received on Thursday, 13 January 2011 20:34:08 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 November 2015 11:01:36 UTC