Forum Moderators: open
<script type="text/javascript">
<!--...
//-->
</script>
<!--
<script type="text/javascript">...
</script>
//-->
However, XML compliant browsers (version 6/7 or later) are allowed to silently remove any content within these comments. This might cause unexpected results!
Note that it doesn't matter whether your page follows HTML, XHTML, or XML - the problem is the same. Therefore, do not use comments in your JavaScript!
The same goes for CSS...
Reference: [w3.org]
C.4. Embedded Style Sheets and Scripts
Use external style sheets if your style sheet uses < or & or ]]> or --. Use external scripts if your script uses < or & or ]]> or --. Note that XML parsers are permitted to silently remove the contents of comments. Therefore, the historical practice of "hiding" scripts and style sheets within "comments" to make the documents backward compatible is likely to not work as expected in XML-based user agents.
I don't know of any reason to continue with the comment tags. 1996 was a long time ago.
Reference:
History of JavaScript, jscript and ECMAScript [webmasterworld.com]
Then, of course, you also have those "blockheaded Bracegirdles from Hardbottle" who teach Web development at Colleges or whatever, and they haven't really kept themselves up to date on browser changes... They think that they don't have to worry about XML/XHTML as long as they teach HTML - which is where they would be wrong.