Live data from Hacker News

Ben the Bodyguard: Gorgeous HTML5 Website

benthebodyguard.com

101–104 of 104 posts

Re: Ben the Bodyguard: Gorgeous HTML5 Website

#101
post #57

Earlier quoted context omitted.

Speaking of DOCTYPE, it seems there is no DOCTYPE on HN.

And somehow it works anyway. It's almost like nobody actually thinks HTML is SGML anymore...

No DOCTYPE means "old document" to the browser and render it in Quirks Mode: http://www.quirksmode.org/css/quirksmode.html

Re: Ben the Bodyguard: Gorgeous HTML5 Website

#104
post #70
post #64

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.

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 http://javascript.crockford.com/script.html

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. :)
Post reply on HN