Skip to content

Comment on JQuery 1.4 and Malformed JSONparent

Comments

Yeah saw some code yesterday it's a wonder a browser accepts <LI><br> <LI><br> <LI><br>

It's stupid how a browser will parse just about anything.

Except that your example is valid HTML 4.01/5. Closing tags are optional.

Also, "Be conservative in what you emit, and liberal in what you accept" - Postel's Law: http://en.wikipedia.org/wiki/Robustness_principle

[edit]: I'm incorrect, some closing tags are optional, </li> being one of them. for HTML5: http://www.whatwg.org/specs/web-apps/current-work/#generate-...

mmm bad example then, also according to the spec it's valid to have a <li> without a <ul> or related tag, didn't know that

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.