Force IE8 to use Browser compatibility view - internet-explorer-8

I have a page using the mixitup jquery script.
It works perfectly in Chrome, Opera and IE11.
But I need it to work in IE8 too.
I have the script working in IE8, just without the fancy animations, which is fine.
Except, it only works in IE8 when I set the browser compatibility view to 'Internet Explorer 8 Compatibility View'.
In the screenshot below, it shows different version, but you can see what option I mean, the second one rather than the first one.
I have tried entering the following meta to the top of page:
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
and also:
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" >
But both those just seem to force the 'Internet Explorer 8', the equivalent to the top options in the screenshot... not the second one, which I need.
Can that be done?
thanks

If I understand your question correctly then may be below explanation will help you.
Using <meta http-equiv="X-UA-Compatible" content=" _______ " />
The Standard User Agent modes (the non-emulate ones) ignore <!DOCTYPE> directives in your page and render based on the standards supported by that version of IE (e.g., IE=8 will better obey table border spacing and some pseudo selectors than IE=7).
Whereas, the Emulate modes tell IE to follow any <!DOCTYPE> directives in your page, rendering standards mode based the version you choose and quirks mode based on IE=5
Possible values for the content attribute are:
content="IE=5"
content="IE=7"
content="IE=EmulateIE7"
content="IE=8"
content="IE=EmulateIE8"
content="IE=9"
content="IE=EmulateIE9"
content="IE=edge"
If meta tag solution wasn't working for you then set it
header('X-UA-Compatible: IE=edge,chrome=1');

Related

Document mode IE7 standards for IE8

My document looks like this:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<!--[if lte IE 8]>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<![endif]-->
I'm using IE10 to test everything. When I switch Browser Mode to IE7 the Page Default Document Mode shows to be IE7 standards. However when I switch to IE8 Browser Mode the Page Default Document Mode is IE8 standards. Why doesn't the meta tag change it to IE7 standards? Is it something to do with my browser configuration? How can I make sure that everyone who look at my site from IE8 get the Document Mode of IE7 by default?
You're hiding the meta tag, so IE10 will never see it. You'll need to remove the conditional comment wrapping.
And then, I presume that when you put IE in IE8 browser mode, that action forces use of the IE8 renderer and thus it will ignore the X-UA-Compatible header.

IE Standards modes

I just have a quick question about IE8 Standards mode vs Quirks mode.
The page displays fine if you load its first page then log in. I have searched for the doc type which i think is right for changing the page to IE8 Standards Mode and i think it works because IE's built in debugger says it's in that mode. Also if you start on another page which uses quirks mode then navigate to my site the debugger changes modes to IE8 standards.
The problem starts if your change the mode to IE8 standards before you visit the page. e.g say your on google and change the mode in the debugger to IE8 standards then visit the site the page isn't displayed correctly.
I hope i've explained my problem clearly enough. I've posted the doctype i'm using is that is any help.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
Add this meta tag to the head
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
This will force IE into the latest standards mode. So if they have IE8 it will be in IE8 even if its set before to other mode.
Also you could start using the html doctype without problem
<!DOCTYPE html>
You can read more about it here:
The IE Blog has posted "How IE8 Determines Document Mode" which you should read. Also, note that MS introduced a (... ah! Geries beat me to the punch while typing this!) Take a look at Geries' comment. :)

Mysterious cross-server display issue

I have a problem I haven't seen before. I am doing a realign on our company's website and am testing locally. However, when I upload to our test server I notice display discrepancies within the same browser (IE8)!
Here is a screenshot of the two pages, both viewed in IE8 but residing on different servers. In the page on the right, you can see there is a weird chunk of white space to the side underneath the .swf file.
Can anyone give any insight as to why the same page on distinct servers would look different in the same browser? I have also noticed a couple of other cross-server bugs within Firefox.
Thanks!
One possibility that comes to mind is IE8's compatibility mode. There is the X-UA-Compatible header directive that forces IE8 into compatibility mode or out of it. Maybe one of the servers sends out that information.
Try adding a compatibility mode directive to the header and see whether it has any effect:
<!-- Mimic Internet Explorer 7 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" >
and alternatively:
<meta http-equiv="X-UA-Compatible" content="IE=100" > <!-- IE8 mode -->
Reference at MSDN: Defining Document Compatibility

Determine if in IE8 Compatibility Mode using conditionals

I understand from my research that IE8 does annoying things like forcing itself into IE7 mode for local intranet hosts and local IP ranges. I understand from a previous question that there is no way to use conditional statements as, irrespective of whether IE8 is rendering in IE8 or IE7 mode, it will still only use the <!--[if IE 8]> conditional.
Since this question was asked a while ago (during the IE8 beta phase by the looks of things) I am wondering if this has changed or if there is any other way using conditionals to determine if IE8 is in compatibility mode.
Thanks!
No, you can't do it using conditionals.
The best way to do it is to use the document.documentMode property as described in the link Pekka posted. How can I detect if IE8 is running in compatibility view?
http://msmvps.com/blogs/paulomorgado/archive/2010/04/05/defining-document-compatibility-in-internet-explorer-8.aspx
In the end, I chose to mix the two common strategies to deal with this bug.
I created an override CSS file, which I import using conditional comments. In the event of IE 8 or 9, though, this override doesn't look as good, so I include the 'force IE into latest rendering mode' header switch, as shown below.
<!--[if lte IE 7]>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="stylesheet" type="text/css" href="/Content/IE7Overrides.csss" />
<![endif]-->
This provides IE7 with a decent failsafe, but forces IE8 and IE9 to show it in the latest browser, which will show the CSS-based table correctly.

why am I triggering quirks mode in IE8?

I'm working on a page that, when I load into IE8 and view the developers tools it tells me that page default is quirks mode.
I've got a strict DTD:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
I even went ahead and put in the explicit standards switch, though I didn't think I'd need to:
<meta http-equiv="X-UA-Compatible" content="IE=8" />
I can't understand why page default isn't IE8 standards?
Only thing I can think of is that to get to this page, I first have to log in to an application and the first pages I must traverse are old quirks mode pages. Does IE decide on which mode to use at a server level, or is it supposed to decide page by page?
Thanks!
Does IE decide on which mode to use at a server level
Not generally, no. There is the ugliness of the compatibility view list, which is site-specific, but that only kicks you back to IE7-style-Standards Mode, not IE5.5-style-Quirks-Mode.
Your code otherwise looks OK, as long as that DOCTYPE is the very first thing on the page. IE will be forced to document.compatMode= 'BackCompat' if there is a comment, PI, XML declaration (prior to IE8) or any non-whitespace textual content before the doctype. If a control character has snuck in that you can't see in your text editor, that could do it.
Example problem page?

Resources