Dealing with IE6? Use IE7-js and rest easy
By jonkarna
Developing websites is something that I enjoy doing, except when it comes to getting them to display well in IE6 as well. I would like to just not support IE6, but many of our clients are still using this browser. I don't understand why people still use IE6, but they do.
For a majority of the last year, I have been using Dean Edwards IE7-js script. This script makes MSIE behave like a standards-compliant browser. I conditionally load this script when the browser is IE6 and below. This script does a great job and I owe many restful nights to its existence. I followed Dean Edwards' blog for a long time after discovering his IE7-js script. Unfortunately, he hasn't posted anything since March.
Problems
There are only a few things that I ran into while using this script. I can't describe some of the little things that I used to run into while using this script, because I have solved those problems too long ago. Here are some of the common problems that I run into:
- The noticable transition during page load
- Problems with table column widths doubling
- Few box model problems
Solutions To These Problems
- In my case, I used to enjoy using the > selector a lot. I also liked making [type=text] and multiple class css definitions. The IE7-js script can fix these problems, but it adds to the amount of work the script has to do. This leads to longer load times in IE6 and bigger notices in movement of elements after the script finishes. Therefore, in addition to changing me styles, I also added a IE6 specific css definition, #container {display: none;}, that hides everything inside of my main container and inserted a line of code into the IE7-js script, document.getElementById("container").style.display = "block". This masks the transition so that the user doesn't have to witness the massacre that is about to happen. They get to see the background for that second of reorganization.
- Never found a direct soltuion to this problem. I didn't really understand why this was happening sometimes, but this was usually solved by IE6 specific css definitions. As my ability to escape tables grew, this became less of a problem.
- This problem occurs in a few places per website. I don't know why or how it chooses its victims, but it happens. Usually a few IE6 specific css definitions to specify a width solves this.
Conclusion
These problems/issues are not that at all. They are little compared to the annoyance of dealing with IE6 without Dean Edwards IE7-js script.
jonkarna 23 months ago
I reorganized some of this article for simplicity. Hope someone finds this helpful.