IE6 Crashes Repeatedly With Floats, Comments And Inputs
Posted on Wednesday, November 14th, 2007
A weird Internet Explorer 6 bug hit me at work recently. One page on a client’s site repeatedly crashed IE6. Not one of the usual CSS support bugs that can be solved with a bit of tweaking and reloading the page to see if it worked, every time I visited this particular page in IE6 the browser just bombed out.
An hour of headaches and starting up the decrepit browser over and over again lead me to the cause of the problem, a seemingly innocent <input type="button" />. Comment out the input and the page loaded, leave it in and IE6 lost it. For the record, IE7 handled the page superbly. But having found the cause of the crashing to be an input, the problems weren’t over, I couldn’t just remove the button as it was necessary for saving the form on the page. More investigation was needed.
The IE Duplicate Characters Bug
After a while I decided to replace the input with text, to see whether that would have any adverse effects and it was the right thing to do! The text appeared twice on the page and I instantly searched for any documentation of duplicating text in IE6. Position Is Everything came to the rescue with this explanation of the IE duplicate characters bug. It turned out that a combination of floats and comments or hidden elements causes text to duplicate if it is in a particular spot. In my case, there was an input in that spot and rather than duplicating the input, the browser just gave up.
A bit of fiddling with comments and moving hidden content around finally left the page in a state to be viewed safely by IE6 again. Sometimes Internet Explorer amuses me, this just confused me for a long time, had I not replaced the input with text I could even still be pondering it. It goes to show that with a lot of time and a bit of luck, you can avoid (most) IE bugs and get your pages back in working order.
If you enjoyed this post, why not subscribe to Unintentionally Blank
1January 28th, 2008 at 2:06 pm
Lawrence Says:I had this problem too. We had a HTML comment before and after java script block and IE6 acted sooo weird! I feel web developers should all begin their pages with: “IE does not follow standards, hence this page will most likely not render correctly. Please use something worth the name ‘browser’ and download FireFox, now!”
I really hate IE! It sucks beyond any recognition!!!
2January 28th, 2008 at 6:54 pm
Phil Says:Hi Lawrence,
If you visit my site using IE you will find an advert in the sidebar to download Firefox, as it happens. The bizarre thing is, this isn’t even a failure in standards, it is a plain and simple bug that makes no sense whichever way you swing it.
I hope you got it sorted out all right?