AppCompat Series – How do you Fix Browser Compatiblity Issues?

November 8, 2009

Many Web designers use browser detection techniques to ensure that their sites display properly when viewed with specific browsers. Some browser detection techniques encounter problems when viewed with later versions of the browser they’re made for. Internet Explorer has the User Agent String which is the identifier that provides data about its version and other attributes to Web servers. Many Websites and applications rely on the User Agent String to detect the Browser settings.

internet-explorer-8Now the issue is that, web pages that explicitly check the User Agent String and do not support the Internet Explorer 8 User Agent String may not run properly. Applications that host Trident will default to Internet Explorer 7 using the Web Optional Component, but will not have access to Internet Explorer 8 features.

A simple Mitigation to this issue would be to ensure that your web applications properly handle the new ‘MSIE 8.0′ version in the User Agent String. see below for example:

Without compatibility mode:
Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)
With compatibility mode:
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)

Also, use Internet Explorer 7 Compatibility View for those applications based on Internet Explorer 7. This can be done either by clicking on the Compatiblity view button or by using meta tags.

Comp_view

See below for meta tag examples.

<html>
<head>
<!-- Mimic Internet Explorer 7 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<title>My Web Page</title>
</head>
<body>
<p>Content goes here.</p>
</body>
</html>

IIS Compatibilty mode

<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<httpProtocol>
<customHeaders>
<clear />
<add name="X-UA-Compatible" value="IE=EmulateIE7" />
</customHeaders>
</httpProtocol>
</system.webServer>
</configuration>

A best practice to detect IE more effectively, is to detect features and not the browser Version details using the “User Agent String”.
You will find this MSDN article handy, when you wanna know a way to detect IE effectively – Here

Other Articles in AppCompat Series

How do you fix OS Version number Issues?

If you’re not a subscriber, you can have msigeek blog notifications delivered to you free via these below options:
RSS Updates , Email Updates and SMS Alerts.

{ 3 trackbacks }

How to make Windows 7 Deployment Easy? - Effective Guides - ms'i'geek
January 25, 2010 at 8:42 PM
How to make Windows 7 Deployment Easy? - Effective Guides
March 1, 2010 at 9:42 AM
TechNet Webcast: Migrating from Internet Explorer 6 to Internet Explorer 8
March 3, 2010 at 10:13 PM

{ 2 comments… read them below or add one }

1 Ambatisreedhar November 8, 2009 at 9:55 PM

Hi Vijay
Recently I installed IE 8 and was wondering about that compatibility view button.I got to know about Trident.I use to do the same in my coding but never thought of this. Thanks for giving good information.

Reply

2 BhuvanaS November 10, 2009 at 9:31 AM

Hi Vijay

Very Handy Info on Browser Compatibility check for Web developers. Good One

Reply

Leave a Comment

Previous post:

Next post: