I have the joyous task of working on an old web application. In several html files, inline javascript is used with the following syntax:
<body>
html goes here...
<script>
<!--
javascript goes here
-->
</script>
</body>
(EDIT: the script tags are inside the body)
Notice the html comment that is wrapped around the entire javascript code. This doesn't really do anything, as all browsers ignore html comments inside script tags. My question is simple: why did a developer from the past ever do this? Was this some kind of optimization or cross browser issue that could be fixed with a html comment "hack"?
I've removed the comments for now and everything looks to work fine.