Home > Uncategorized > How to Handle Malformed HTML

How to Handle Malformed HTML

October 25, 2004

The debate on how to handle malformed html has been going on for quite some time. Malformed html can be described as html that does not conform to the W3C’s standards, in particular when Microsoft and some others create their own extensions to html.

The root of this problem is that html is so easy to write, that it doesn’t take much expertise to create a web page. And often, these inexperienced web page writers take advantage of IE’s tolerance on malformed html by testing it just in IE. And to make matters even worse, since IE renders malformed html and while most other browsers would ignore the problem html, some web developers are led to believe that IE has better support for html.

With valid html when you specify, for example, <table>…</table> you would expect a table. However, if you didn’t follow the rules, according to the W3C standards, it is to ignore those tags in question. If each browser were to make a guess, they would have a different display of the same page. And even different views between the various versions of the same browser. And this is why bad html should not be rendered.

The fact that malformed html should not be rendered, doesn’t mean that the browser should crash in that event. It seems that all browsers are guilty of this. IE always crashes. Opera on occasion will also crash. Here is how to make Opera crash. Create an html file with the following.
< HTML> < TBODY> < COL SPAN=999999999>
Don’t add any of the closing tags, save as an html file and open in Opera … crash.

This is a discussion for another time on whether the browser should crash on malformed html. Stay tuned.

Advertisements
Categories: Uncategorized
  1. October 26, 2004 at 9:16 am

    Initially when I posted the above, I had < HTML> < TBODY> < COL SPAN=999999999> without the spaces after the “<“. This caused my Opera browser to crash every time I tried logging into my Blogger account. After adding the space, my account loaded as usual.

  2. rck
    June 6, 2005 at 5:09 pm

    Pretty cool trick! I’ve put the code in a html file, fed Opera 7.5 with it and the next moment it was gone.

    Didn’t happen in Opera 8 which simply ignores the markup it seems.

    René C. Kiesler

  1. No trackbacks yet.
Comments are closed.
%d bloggers like this: