What does <! - in javascript?
It's so hard to find characters on Google, so I ask here.
<!--Looks like a comment to me, but it doesn't work like html. Or is this one line of comment like //?
What is the purpose and advantage of using this? Thanks
code example:
<script type="text/javascript">
<!--
alert("example");
//-->
</script>
+5
4 answers
This is an old method of hiding JavaScript from browsers that treated the text of the node element scriptas plain text (and displayed your code).
Douglas Crockford recommends that you no longer use it.
<!-- //-->. Netscape 1 Mosaic. .<!-- //-->HTML. , . , HTML--, script, , HTML.
+7