Possible Duplicate:
Using HTML comment tag <!— –> still relevant around JavaScript code?
Kind of remember <!-- //--> is used to prevent JavaScript code from being displayed in a lower version of IE. Anyone can provide a link to the article explaining this? Hard to search “<!--” in Google, because it’s got stripped off.
And do we still need this in JavaScript block?
Thanks!
Those comments were used when Javascript was first introduced. They are not needed any more, and haven’t been for quite a while.
The purpose was to hide the script from browsers that didn’t even know what the
scripttag was for. Those browsers would ignore the script tag and show the code inside as regular HTML content.There are no browsers left that don’t know about the
<script>tag, so even if they don’t run the script, they still don’t show the code inside.