5

I am developing an HTML application and I was originally targeting IE7 because half of the company still had that particular version. They just upgraded to IE8 this week and I'm trying to get rid of any IE7 specific code.

One thing I noticed while using the IE developer tools is that when I view the home page on my local server, the Document Mode is set to IE8 Standards. If I view the same exact code base on my test server, it defaults to IE7 standards:

This is what I see when I look at developer tools on each server:

http://localhost:12345/
Browser Mode: IE8
Document Mode: IE8 Standards (Page Default)

http://webtest01/
Browser Mode: IE8 Compat View
Document Mode: IE7 Standards (Page Default)

What is causing them to be different on different servers?

EDIT
I think it is because Internet Explorer has a setting to display Local Intranet sites in Compatibility View. Is there a tag I can use to override this for my site?

Dismissile
  • 32,564
  • 38
  • 174
  • 263

1 Answers1

6

IE is puts webtest01 in the Local Intranet Zone, which forces IE8 Compat browser mode/IE7 mode document mode.

I believe you can add a X-UA-Compatible HTTP header (or <meta> tag, so long as it's the first tag in your head), which should get the document mode into IE8 standards, but cannot fix browser mode, which has subtle implications for scripts.

To get IE out of compatibility browser mode, You have to go to Internet Options > Sercurity > Local Intranet > Sites and make sure everything is unchecked, or go to Tools > Compatibilty View Options and uncheck Display intranet sites in Compatibility View.

Community
  • 1
  • 1
josh3736
  • 139,160
  • 33
  • 216
  • 263
  • Is there anything that an IT person can do so that my specific site does not automatically use Compatibility View even if it's in the Intranet? I can't really ask my users to do this step because they are not very technical. – Dismissile Feb 02 '12 at 15:24
  • @Dismissile: Actually, it looks like you can add a HTTP header to fix the *document mode* (see updates), which gets you ~90% of the way. To configure all your machines to not use intranet compatibility mode, you'll need to use [group policy](http://blogs.msdn.com/b/ie/archive/2008/10/02/ie8-group-policy.aspx) to enable "Turn on Internet Explorer Standards Mode for Local Intranet" in `Windows Components\Internet Explorer\Compatibility View`. – josh3736 Feb 02 '12 at 15:35
  • Is that going to affect every Intranet site or only my own? Because the former is not really acceptable. there could be other Intranet sites at the company that need Compatibility View. However, if the HTTP header gets me 90% of the way then it might be enough. I will have to check. I am only having one specific problem that I need to take care of and Document mode might fix it. – Dismissile Feb 02 '12 at 15:45
  • @Dismissile: Yes, this is a global setting that affects all intranet sites. You might also be able to add your site to the Trusted Sites Zone -- I'm not sure, but that might prevent the intranet settings from being applied to your site. – josh3736 Feb 02 '12 at 16:24