Getting ready for IE8
by Mike Badgley on April 20, 2009
With Internet Explorer 8 now coming out of beta and being released to the public via an Automatic Update in Windows XP, we all need to ensure that our Web sites perform properly when viewed in this browser.
Up to this point, I’ve pretty much ignored it – and rarely have I tested any of my HTML templates with it. Take that, plus the new JavaScript engine IE8 features, and you can see that there are bound to be display and functional problems.
Although we welcome and look forward to new browser releases, especially those, like IE, that are used by the majority of users, it can bring a lot of aggravation and annoyance. Testing has to be done to ensure that all our old Web sites still work within the new browser – and this can be quite time consuming!
This time around, however, there is nothing to fear and the transition of our Web sites from IE7 to IE8 can be seamless thanks to the compatibility mode built within the IE8 browser. What this means, is that the simple addition of a meta tag (see below) to any Web page will force IE8 to render said page (including JavaScript functionality) as if it was an IE7 browser.
<meta http-equiv="X-UA-Compatible" content="IE=7" />
I tried this technique out on a couple of Web sites that were failing badly when rendered in IE8. In one case it was just the CSS that was going screwy, while in the other case it was both the CSS and JavaScript that were causing problems. After I inserted the above meta tag, the page rendered the way it would in IE7 – how cool is that!?
Needless to say, this is a very helpful feature of the browser and will save us all a lot of time and effort.