Jan 08, 2008

Updated Dean Edwards’ IE7 Scripts

As I have noted in previous posts: Using Dean Edwards’ IE7 Script, The Ultimate PNG Guide, I am a big advocate of the Dean Edwards’ IE7 scripts.

Thankfully, Dean has improved them even more. Instead of having a ton of different JavaScript files with large file sizes, he has compressed them into two light-weight JavaScript files.

The are now two scripts, IE7.js and IE8.js, and they are hosted on Google Code. The IE7.js file “fixes” IE5 and IE6 so that it is up to par with IE7. Then, IE8.js adds in some additional functionality that is missing from IE7. Note: If you include IE8.js, you do not need to include IE7.js.

Usage

There are a couple of different options here, you can either download the files and place them on your server or link directly to the Google Code version.

Option 1: Download Files

  1. Download the ZIP file.
  2. Extract the IE7 folder to the root of your server.
  3. Include the script in the head of your document:

    <!--[if lt IE 7]>
    <script src="/ie7/IE8.js" type="text/javascript"></script>
    <![endif]--> 

    In this example, I am targeting all versions of Internet Explorer less than IE7, and applying the IE8 script to it. Or, you could apply the IE7 script instead, I just wanted the advanced CSS functionality.

    You could also set it so that it is applied in IE7 as well:

    <!--[if lte IE 7]>
    <script src="/ie7/IE8.js" type="text/javascript"></script>
    <![endif]--> 
  4. Open IE6 and enjoy some things not being broken.

Option 2: Link to Google Code Files

  1. Find the version of the file you want to use
  2. Copy the URL, ex: http://ie7-js.googlecode.com/svn/version/2.0(beta)/IE8.js
  3. Include the script in the head of your document:

    <!--[if lt IE 7]>
    <script src="http://ie7-js.googlecode.com/svn/version/2.0(beta)/IE8.js" type="text/javascript"></script>
    <![endif]--> 
  4. Smile, you just “fixed” IE6.

Hopefully that should get you started with what you need. My previous articles: Using Dean Edwards’ IE7 Script, The Ultimate PNG Guide have some other details about the previous version of the script, some of which still apply.

Let me know if you have questions.

Categories