As a web developer, I’m often forced to support for outdated browsers like Internet Explorer 7. This requirement forces my hand to add wonky code to code that was otherwise working fine everywhere else. To help test my sites in multiple versions of Internet Explorer, I use Internet Explorer 9 on Windows 7 and use the Developer Tools to change the rendering mode of the page between IE 7, 8, and 9. It’s important to note that this is not an exact representation of what a user with Internet Explorer 7 would see on the page, but it is accurate enough for me.

One thing I found pretty early on is that while Internet Explorer 9 is rendering a page as IE 7, it’s user agent string still identifies itself as Internet Explorer 9 meaning that browser detection in JavaScript is likely to return the wrong results. So in addition to testing the user agent string for MSIE 7 (which would work on an actual version of IE7), I also test the value of document.documentMode. This value represents the mode the page is being rendered in (returns 7 for IE7).

Here’s Microsoft’s official tech docs about this property:


Comments are closed.

Set your Twitter account name in your settings to use the TwitterBar Section.