Tuesday, November 10, 2009

Javascripts that make web pages IE6 compatible


We all know Internet Explorer 6 is a big pain in the ass, especially if you do web design/development. Professional web designers despise IE6, and often charge extra for making websites compatible to IE6 because of the additional effort needed and the time wasted on bug hunting. Here is one way to allay their troubles.

Internet_Explorer IE7 Script is a JavaScript library that makes Internet Explorer behave more like a standards-compliant browser. It fixes many HTML and CSS issues and makes transparent PNG work correctly under IE5 and IE6. The library consists of several scripts, the chief of which is ie7.js. Using this script you can fix many troublesome issues which are not possible using separate stylesheets for instance: Fixed positioning, Maximum and minimum width and height, parent>child selector etc.

Additional bugs can be corrected by using another script called ie7-squish.js. The complete list of fixes is documented here.

To use the script all you have to do is call this Javascript library if the page is accessed from Internet Explorer using the IE conditional tag.

<!--[if lt IE 7]>
<script src="http://ie7-js.googlecode.com/svn/version/2.0(beta3)/IE7.js"

<script src="http://ie7-js.googlecode.com/svn/version/2.0(beta3)/IE7-squish.js"


The other files in the library will be run from this script. If you choose to host the files on your own server, you can do that too.

Author Dean Edwards explains that the reason that ie7-squish is not included as an integral part of ie7.js is that it will change the behavior of some elements that can result in damage to some layouts when viewed using IE6. It is therefore up to the author to test and check whether applying squish is necessary in the first place and, if so, to test to see if it does any damage. In some cases residual issues may need a specific stylesheet to be targeted at IE6 in the traditional way to clear up remaining issues.

Dean has created another script called IE8.js Script that includes all that is in ie7.js along with many enhancements for IE7 regarding support in CSS. The result is a dramatic improvement in conformance for both IE6 and IE7.

Also see IE6 CSS Fixer, that automatically applies IE6 specific hacks to stylesheets.


Post a Comment

Popular Posts