W3C home > Mailing lists > Public > www-validator@w3.org > April 2005

comments in javascript

From: Bill Milbratz <bmilbratz@outstart.com>
Date: Fri, 15 Apr 2005 18:24:31 -0500
To: www-validator@w3.org
Message-Id: <1113607471.8681.36.camel@localhost>

Hi,

This seems like such a basic issue that it would come up often. However
I didn't see this precise issue in the mailing list archives. Nor did
the script section of the WDG "common validation problems" cover this
error. 

The w3-c validator marks as invalid Html-4.01-transitional the following
lines. It does not like the comment indicator on line 2 ('//') or the
url on line 3 below:

1.  <script type="text/javascript">
2.    // Do something
3.    window.location="/mywebapp/index.html";
4.  </script>


I understand that this would cause an error:
  document.write("</foo>");

but must I/you/we escape *every* forward slash between the <script>
tags?


thanks,

bill m
Received on Friday, 15 April 2005 23:24:34 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 April 2012 12:14:18 GMT