IE8 switching into IE7 standards mode: how to discover why RRS feed

  • Question

  • Hi,

    we're having a bit of a strange issue here.

    We've got a website on a production environment working perfectly in IE8 mode.
    Though an exact copy of this site on one of the other DTA(P) environments lets IE switch into IE7 Standards mode.

    We've tried to check:

     - nothing like a meta tag telling it should do that
     - doctype seems fine
     - the xml file res://iecompat.dll/iecompatdata.xml has been checked, non of both url's are on it
     - and we checked some other things that are mentioned on fora like http://blogs.msdn.com/askie/archive/2009/03/23/understanding-compatibility-modes-in-internet-explorer-8.aspx etc.

    Though... still... we get this on multiple computers.

    Q: Is there any way to see WHY IE is choosing the mode?

    note. javascript:alert(document.documentMode); from http://msdn.microsoft.com/en-us/library/cc288325(VS.85).aspx
    doen't help here.


    Wednesday, May 19, 2010 7:02 PM

All replies

  • Hi,

    When testing sites turn off "Automatically recover from rendering errors with Compatibility View" on the Advanced tab of internet Options.

    This will stop IE's error handling tripping the Compatibility view error handling.

    Validate your markup at validator.w3.org (F12, Validate>HTML from the IE8 Developer tool) and correct the Errors that it finds. You can also toggle the Browser Mode from the IE Developer toolbar and use the Scripting debugger to trace what happens when you force the page(s) to use Standards (IE8) mode. The most likely cause is poor codeing.... correct your markup errors!

    Check your userAgent string (http://www.enhanceie.com/ua.aspx) to ensure that it is not corrupted and reporting the wrong IE version to those sites if they are using Browser Sniffing to serve up different page versions.

    Review your Compatibility View Settings. Are you forcing all sites or intranet sites to use Compatibility View?

    Check the response headers using the Fiddler Tool (http://www.fiddlertool.com) to see if the servers are using the server response to force IE7 emulation mode.

    document.documentMode will test for this when you compare it with your validated page DTD's.... A common mistake is a malformed/incorrect DTD declaration.


    Wednesday, May 19, 2010 9:52 PM
  • Hi Rob,

    thanks for the tips. In the end: it was that nasty 'intranet' site checkbox.... our development machine was in our network.

    Though still the real question remains:

    Q: Is there any way to see WHY IE is choosing the mode? Thus: Can IE tell me BASED ON WHAT it chooses. E.g. in this case a message: 'intranet setting'.


    Thursday, May 20, 2010 10:15 PM
  • Hi,

    Basicly No.

    You have to devise a test plan for your web pages.

    Before you even start, you should choose a target DTD (Doctype declaration) for your target browser set and then validate each of your pages (validator.w3.org) to correct any markup errors that may trip IE8's error handling and make it fall back to IE7 Emulation or Quirks mode.

    From there (if your pages are validated) you have a benchmark as to what you expect IE's Browser Mode will be. You can see the Browser Mode selected on the Developer Tool. If your pages validate to your chosen DTD then IE8 will render in the IE8 'Standards' mode. If it doesn't (and your pages validate) then you would look for other reasons why IE8 would fall back to IE7 or Quirks Mode. These include

    The Compatibility View Meta and Server Header tags are present.

    Your test environment web site is in the IE8's compatibility view lists (either user added or in the lists that MS distribute... see the Compatibility View Settings dialog).

    You testing cycle should include....

    Placing your site in the Internet Zone, the Trusted Zone and in the Restricted Zone, making sure that you have removed it from your Intranet Zone first.

    Before you start testing you should ensure that IE's settings are at their Default ("recommended") settings.

    Tools>Internet Options, Security tab, click "Reset all zones to default" and also reset the Advanced tab settings ("Reset Advanced" button on the Advanced tab of Internet Options").

    I usually turn off "Automatically recover from rendering errors with Compatibility View" on the Advanced tab of IEO, so that if the Browser Mode is not what I expected (and my markup is validated) then I know it is either the Emulation meta tag or server header, or a Compatibility View setting that is forcing it to render in a non-standards mode.

    Additional you should also test with IE in no-Addons mode... there are some IE Addons that alter the expected rendering outcome (Chrome Frame, Form fillers).

    I can't over-emphasise it enough... validate, validate, validate....

    I use Visual Studio and Expression Web which has intellisence and markup validation built-in to the IDE. By adjusting the IDE options your cannot even compile the site untill you have corrected your markup errors.

    The nut holding the keyboard is the weakest link. We all make mistakes, either because of lack of experience or just simple typo's. HTML is NOT a compiled language. The mistakes we make in the development phase are never detected unless we run the code through a validator.

    Of coarse as a developer you should also test your sites in other Browsers. Be aware that the Other browsers do not have the same Security Zone structure as IE browsers.

    The IETabs FX and Chrome extensions does not use the Security Zone model of MSIE browsers and will ONLY use the IE7 rendering engine. If your site works in IETabs but not in a MSIE browser then you know it is one of your IE Security Zone settings... that is why it is important to always ensure that your security zone settings are set to their defaults. Don't try to tweak the security zone settings to accomodate your site.


    Friday, May 21, 2010 12:00 AM
  • In addition to this, it should be noted that when you're working in the Intranet, compatibility mode is enabled by default and will override the DOCTYPE and META tags on the page.  This means that if you want it to render properly in IE8 mode, you must use the group policy settings or go to each computer, go into the Compatibility View Settings  and disable the Intranet compatibility mode default.

    Group Policy: Administrative Templates/Windows Components/Internet Explorer/Compatibility View/Turn on Internet Explorer Standards Mode for Local Intranet (set to enabled)

    Manual Configuration:

    1. Open Internet Explorer 8.
    2. In the upper-righthand corner, click on the Tools button and select "Compatibility View Settings".
    3. Uncheck the "Display intranet sites in Compatibility View" option.
    4. Add any servers that host IE6/IE7-only web applications to the domain list, if you have any.
    5. Click on "Close".
    Tuesday, June 1, 2010 3:18 PM
  • Though we fixed our problem already, I thank you all for responding.



    Though still the real question is probably a Change Request for Internet Explorer (might a MSIE-programmer take a look at the discussion):

    Make a way to see WHY IE is choosing a render mode.
    Thus: Make IE tell me BASED ON WHAT it chooses it's render mode. E.g. in this case a message: 'intranet setting'.


    Debugging this takes a lot of time, and it's a waste of time, since IE knows exactly why it chooses something, therefor it should be available via the API .




    • Edited by i-am-will Tuesday, June 1, 2010 3:38 PM made it more clear
    Tuesday, June 1, 2010 3:37 PM