How do I stop I.E. jumping into compatability view

7

1

Possible Duplicate:
IE: Why does Compatibility View disappear for some websites?

At certain points in the application I am writing, I get a pop up bubble saying "A problem displaying XXX caused Internet Explorer to refresh the webpage using Compatibility View."

This causes the browser to refresh and switch to compatibility view. Other than hunting down what is causing this, is there anyway I can prevent this from happening for users of the site? Is the some meta tag or some such I can put on the page?

alt text

Dan

Posted 2010-11-26T10:38:09.823

Reputation: 740

Question was closed 2011-08-28T15:38:24.150

3May I recommend you ask on StackOverflow about how to fix your application pages so they do not generate the error that upsets IE8 in the first place? Because the chances are they are probably going to upset other browsers as well. From a served page you can only request IE8 to switch into compatability mode (via a meta header IIRC), but you cannot request not to use compatability mode - so you cannot achieve this without somehow changing the settings of every user that visits your site (or, as said, fixing the pages). – DMA57361 – 2010-11-26T11:14:53.533

This question was answered here... http://superuser.com/q/215735/20433

– SgtOJ – 2011-08-28T15:20:53.247

Answers

5

Try added this meta tag to your heading first...
<meta http-equiv="X-UA-Compatible" content="IE=edge" >

If you get an error and it switches then try this one. This will automatically set it in Compatibility View...
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" >

More information about this tag can be found here...
http://msdn.microsoft.com/en-us/library/cc288325(v=VS.85).aspx


More information...

The latter of the two examples will put then browser in to Compatibility View from the start. Subsequently, means your site will not need to crash before switching. Also the user should never see the error posted in your screenshot.

This feature, or meta tag, was added for webmasters or developers tp have temporary fix after a new release of Internet Explorer. Therefore the only real fix comes down to programming in such away that prevents this from happening. To explain, you need to either program using latest standards, program around the many limitations of Internet Explorer (8 or older), or use a JavaScript library such as jQuery. That is assuming the error or problem in your code is JavaScript related. If it is, then jQuery is a great solution. It will allow you to program once to allow your scripts/webapps to work nearly prefect or as close as possible with all browsers.

Here are a list of reason a site will switch to Compatibility View: the user has the site listed as a site to always go in to Compatibility View; the site is listed by Microsoft to have better user-experience when render in Compatibility View -- the list is update via Windows Update; the site causes such a big problem the browser switches to Compatibility View -- your case; the site has a meta tag that tell the browser to render the browser like IE7 or IE8 -- a.k.a. Compatibility View.

SgtOJ

Posted 2010-11-26T10:38:09.823

Reputation: 6 843

Updated the second half of my answer. Also the meta tags should work. – SgtOJ – 2010-11-30T00:30:46.460

3

Go into to tools, internet options, advanced and deselect "Automatically recover from page layout errors with compatibility view"

Tog

Posted 2010-11-26T10:38:09.823

Reputation: 4 747

I was thinking more - something that would prevent this happening for all users of the site, without them having to explicitly enable it ? – Dan – 2010-11-26T10:50:49.083

Dan: Stop using IE quirks? – paradroid – 2010-11-26T11:00:20.457

@jason44 Sorry what do you mean? The browser is not in Quirks mode - this jump happens when I.E. 8 is set for the Browser and Document Mode. And this is not something I would want site users to care about. – Dan – 2010-11-26T11:04:33.133

@Dan: I meant that you are using IE6 quirks in your code, which is making IE jump into Compatibility Mode. Anyway, don't you want your webapp to work properly on all browsers? – paradroid – 2010-11-26T11:10:55.797

@Dan, why don't you force Quirks Mode then, if you want to write code with IE quirks? – paradroid – 2010-11-26T11:15:35.510