Why does this Javascript code inside a non-Javascript browser have extra commenting?

后端 未结 4 1403
-上瘾入骨i
-上瘾入骨i 2021-01-21 00:56

On the W3 tutorial, it shows htis code:




JavaScript doesn't know HTML's comment closing -->, so it has to be commented out of script. There is no need to use HTML-comments to separate JavaScript, except if you're using a simple text editor which colours the code (NoteTab etc.).

提交回复
热议问题