comments in javascript

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 UTC