Re:Ben the Bodyguard: Gorgeous HTML5 Website
by sjs on Thursday December 02, 2010 @12:57PM
(#1962962)
There are HTML comments in the JavaScript at the bottom of the source, sandwiched in between the GA tracking code and some Google optimizer stuff. I didn't get any JS errors, so is that legal? Are the comments stripped before the text content of the script element is processed? If so that's pretty wild! Never knew that was possible.
[ Parent
| on HN ]
Re:Ben the Bodyguard: Gorgeous HTML5 Website
by zerohp on Thursday December 02, 2010 @03:40PM
(#1963566)
In the bad old days of early web development, browsers that didn't understand the script tag would display your code in the document. They allowed html comments inside the script tag as a workaround for it. We always had to write <script><!-- //--></script>
Re:Ben the Bodyguard: Gorgeous HTML5 Website
by sjs on Saturday December 04, 2010 @02:19PM
(#1969906)
Ah, I had seen that written with //<!-- to open the comment and always wondered why people would settle for old browsers displaying // in the script tag, looks like it wasn't required and was just bad code written by people who didn't know what they were doing. So it goes. :)