Force IE9 to emulate IE8. Possible? - html

Is this possible at all?
I tried adding this to the page but it didn't change a thing.
<meta http-equiv="X-UA-Compatible" content="IE=8">
UPDATE- I'm trying to do this because our site has some IE9 specific CSS issues, which wouldn't appear in IE8.
Thanks

You can use the document compatibility
mode to do this, which is what you
were trying.. However, thing to note
is: It must appear in the Web page's
header (the HEAD section) before all
other elements, except for the title
element and other meta elements Hope
that was the issue.. Also, The
X-UA-compatible header is not case
sensitive Refer:
http://msdn.microsoft.com/en-us/library/cc288325%28v=vs.85%29.aspx#SetMode
Edit: in case something happens to kill the msdn link, here is the content:
Specifying Document Compatibility Modes
You can use document modes to control the way Internet Explorer
interprets and displays your webpage. To specify a specific document
mode for your webpage, use the meta element to include an
X-UA-Compatible header in your webpage, as shown in the following
example.
<html>
<head>
<!-- Enable IE9 Standards mode -->
<meta http-equiv="X-UA-Compatible" content="IE=9" >
<title>My webpage</title>
</head>
<body>
<p>Content goes here.</p>
</body>
</html>
If you view this webpage in Internet Explorer 9, it will be displayed
in IE9 mode.
The following example specifies EmulateIE7 mode.
<html>
<head>
<!-- Mimic Internet Explorer 7 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" >
<title>My webpage</title>
</head>
<body>
<p>Content goes here.</p>
</body>
</html>
In this example, the X-UA-Compatible header directs Internet Explorer
to mimic the behavior of Internet Explorer 7 when determining how to
display the webpage. This means that Internet Explorer will use the
directive (or lack thereof) to choose the appropriate
document type. Because this page does not contain a
directive, the example would be displayed in IE5 (Quirks) mode.

Yes. Recent versions of IE (IE8 or above) let you adjust that. Here's how:
Fire up Internet Explorer.
Click the 'Tools' menu, then click 'Developer Tools'. Alternatively, just press F12.
That should open the Developer Tools window. That window has two menu items that are of interest:
Browser Mode. This setting determines the value of the user-agent header sent for every request.
Document Mode. This setting determines how the rendering engine renders the page.
More at http://blogs.msdn.com/b/ie/archive/2010/06/16/ie-s-compatibility-features-for-site-developers.aspx

The 1st element as in no hard returns. A hard return I guess = an empty node/element in the DOM which becomes the 1st element disabling the doc compatability meta tag.

On the client side you can add and remove websites to be displayed in Compatibility View from Compatibility View Settings window of IE:
Tools-> Compatibility View Settings

Related

Force IE9 Document Standards in IE10

When I view my website in IE10, it seems that it's automatically forcing IE8 document standards. However, I would like it to use IE9 standards, when being viewed in IE10.
Is there a way to do this?
The page has <!DOCTYPE html> at the top.
EDIT: It turned out that I had <meta http-equiv="X-UA-Compatible" content="IE=8" /> in the page header, which was causing the page to render in IE8 document mode. Changing this to IE=9 fixed the issue.
I recommend to use the X-UA meta tag. The X-UA-Compatible meta tag allows you to choose what version of Internet Explorer the page should be rendered as.
You specify the user agent and version to use in the contents of the tag. The current options you have for the content are: IE=5, IE=EmulateIE7, IE=7, IE=EmulateIE8, IE=8, IE=EmulateIE9, IE=9, IE=edge.
Emulating the version tells the browser to use the DOCTYPE to determine how to render content. Pages without a DOCTYPE will be rendered in quirks mode. If you tell it to use the browser version without emulating (i.e. IE=7) the browser will render the page in standards mode whether or not there is a DOCTYPE declaration. IE=edge tells Internet Explorer to use the highest mode available to that version of IE. Internet Explorer 8 can support up to IE8 modes, IE9 can support IE9 modes and so on.
I think you need this:
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
Use X-UA meta tag:
<meta http-equiv="X-UA-Compatible" content="IE=9" />
And I don't know why you want to do this, as IE 10 is far more excellent than any of the previous versions of IE, if you are testing, you can press F12 and change the mode

How to force IE10 to render page in IE9 document mode

I have two questions:
How can I force IE10 to render in IE9 document mode? Currently it's rendering my page in Standard document mode.
In IE10's developer toolbar, I am not able to see the option of document mode of IE10. Is it not implemented, or is my browser version is out of date?
Thanks for all your help.
Edit: thanks everyone for the solutions provided. Earlier I was using a meta tag
<meta http-equiv="x-ua-compatible" content="IE=edge" >
just to make sure that IE will render the page in highest document mode, but I was facing some issues with IE10 standard mode, so I changed the meta tag to render the page in IE9 mode:
<meta http-equiv="x-ua-compatible" content="IE=9" >.
You should be able to do it using the X-UA meta tag:
<meta http-equiv="X-UA-Compatible" content="IE=9" />
However, if you find yourself having to do this, you're probably doing something wrong and should take a look at what you're doing and see if you can do it a different/better way.
Do you mean you want to tell your copy of IE 10 to render the pages it views in IE 9 mode?
Or do you mean you want your website to force IE 10 to render it in IE 9 mode?
For the former:
To force a webpage you are viewing in Internet Explorer 10 into a particular document compatibility mode, first open F12 Tools by pressing the F12 key. Then, on the Browser Mode menu, click Internet Explorer 10, and on the Document Mode menu, click Standards.
http://msdn.microsoft.com/en-gb/library/ie/hh920756(v=vs.85).aspx
For the latter, the other answers are correct, but I wouldn't advise doing that. IE 10 is more standards-compliant (i.e. more similar to other browsers) than IE 9.
You can tweak the Registry if you want to make changes only to your own system. If you have IE10 and lots of web sites you visit don't render properly in IE10, then you can tweak your registry to force IE to open in IE9 mode.
HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION
Create a DWORD as iexplore.exe and give value 9999. Restart your IE and it will open in IE9 mode :)
Thanks to my colleague Sreejith D :)
I haven't seen this done before, but this is how it was done for emulating IE 8/7 when using IE 9:
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9">
If not, then try this one:
<meta http-equiv="X-UA-Compatible" content="IE=9">
Add those to your header with the other meta tags. This should force IE10 to render as IE9.
Another option you could do (assuming you are using PHP) is add this to your .htaccess file:
Header set X-UA-Compatible "IE=9"
This will perform the action universally, rather than having to worry about adding the meta tag to all of your headers.
By what this says, IE10 (the article is referred to a preview release, anyway) it's able to use X-UA-Compatible only if the document is in quirks mode (no DOCTYPE), otherwise IE10 won't react to the request.
Here's an excerpt:
Thus, to make IE10 react to the X-UA-Compatible directive, one must either create a page that triggers quirks-mode per the rules of HTML5 (that is: an a page with no doctype). One can also send the directive as a HTTP header, however: A HTTP sent directive appears to have no effect if you use it to downgrade the rendering — it can only be used to upgrade the rendering
So, you've to do it manually with Dvelopers Tools, or with quirks mode (but I suggest to stay in IE10 mode which is for the first time aligned to the other browers' standard)
EDIT: The follows are some useful link to read:
http://msdn.microsoft.com/en-us/library/cc288325(v=vs.85).aspx
http://msdn.microsoft.com/en-us/library/jj676915(v=vs.85).aspx
http://blogs.msdn.com/b/ie/archive/2011/12/14/interoperable-html5-quirks-mode-in-ie10.aspx
You can force IE10 to render in IE9 mode by adding:
<meta http-equiv="X-UA-Compatible" content="IE=9">
in your <head> tag.
See MSDN for more information...
there are many ways can do this:
add X-UA-Compatible
tag to head
http response header
using IE tools F12
change windows Registry
The hack is recursive. It is like IE itself uses the component that is used by many other processes which want "web component". Hence in registry we add IEXPLORE.exe. In effect it is a recursive hack.
I found this post while I was looking for a solution to my DNN6 website.
The error was
SCRIPT5007: Unable to get property 'documentElement' of undefined or
null reference
But I needed the same solution: force compability mode to IE9. So let me share with you what I did to solve this.
So, for DotNetNuke 6 users try the StyleHelper SkinObject
Worked great for me!

Why does IE9 opens in Document Mode as IE7 standards?

When I open a webpage in IE9 with DOCTYPE as
<!DOCTYPE html>
It opens Document Mode as IE7 standards.
I need default IE9 standards on opening the page.
How to correct this document mode problem?
A screenshot of how it comes in IE browser developer tool
Try this answer: https://stackoverflow.com/a/13524518/1679310.
Summary, give the IE browser more information in the meta tag:
<!DOCTYPE html>
<html>
<head>
<title>My Web</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
Edit Note: As Olly Hodgson mentioned, the proper option is IE=edge, as currently stated in the above snippet. Below is the original, also working version:
<meta http-equiv="X-UA-Compatible" content="IE=100" />
There can be multiple reasons why it could be parsing the document under IE7 standard:
The server is sending a X-UA-Compatible header for IE7 in the HTTP response of the document. Check the server response headers using a tool like Fiddler.
The HTML document is setting a meta tag with the X-UA-Compatible property value for IE7.
The page is being detected automatically by IE for opening in "Compatibility view". Note here that by default all intranet sites are viewed in "Compatibility view" in IE. Uncheck the checkbox "Display intranet sites in Compatibility view" under Tools -> Compatibility view settings in IE. The "Display all websites in Compatibility view" should be unchecked too.
You used the Developer tools and explicitly set to view the page to render in "IE7 standards" mode. Note that this will only occur on a per client basis though.
Update 2016-01-28
As #Gordon pointed out in the comments below, another reason can be that the network administrator has set the site for compatibility view as a Group Policy on the network.
The only resolution in that case is to contact the network administrator to remove the site from the Group Policy. See HTML1203 here.
You can set this in the web.config as well.
<system.webServer>
<httpProtocol>
<customHeaders>
<clear />
<add name="X-UA-Compatible" value="IE=edge" />
</customHeaders>
</httpProtocol>
Does your page contain the meta tag for forcing IE7?
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
this will force the page to use IE7 compatibility.
Just wanted to share that if your web server is Apache2 you could set the Response header like below in your VirtualHost configuration which will also resolve the issue.
Header set X-UA-Compatible "IE=edge"
The issue appears to be specific to the combination of IE9 and compatibility mode. For us, we cannot disable compatibility mode since it is a SharePoint 2013 site and IE11 must run in compatibility mode to edit pages, but IE9 was behaving as you are showing. Setting the X-UA-Compatible to "IE=edge" in a meta tag did fix our issue, although setting the value to IE=10 did not affect our behavior. We also have the same doctype.
If your project is ASP.NET MVC, make sure that you add the:
<meta http-equiv="X-UA-Compatible" content="IE=edge">
tag into your Layout (template) page. I just spent two hours debugging and tweaking, only to realize that I had only added that meta tag into my child pages. As soon as I added it to my layout page, the browser loaded in EDGE mode perfectly.

Why does IE8 display a compatibility view button when IE9 doesn't?

On one of my sites, IE 8 is displaying the compatibility view button despite the presence of the X-UA-Compatible header. In IE 9, adding this header removes the button and sets the correct rendering mode, but why doesn't it do the same under IE 8? If the user clicks the button in IE8, the site rendering breaks on several pages so how can I remove this button to stop them clicking it?
The site in question is www.venuefinder.com
your page is including the following meta tag:
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9" />
Thus IE9 hides the button and IE8 doesn't understand it (since IE9 didn't exist when IE8 was shipping)
To ensure both IE8 and IE9 (and IE10) don't show the button you'd likely want to adjust your page to include a modern DOCTYPE
<!doctype html>
and set the meta tag to edge
<meta http-equiv="X-UA-Compatible" content="IE=edge" />

IE8 compatibility mode button missing

I'm developing a website using Umbraco and I'd like to flick between IE8 and IE7 using the compatibility button, but it's hidden. It is an internal address but I've not had the problem with similar sites on the same server. (The only difference is this is using a 'non-standard' port 8080, I shouldn't think that would make a difference?)
I've checked the following blog post; Compatibility View Button Missing in IE8
Which states,
The Compatibility View button will be missing for the following
reasons,
If you’re viewing any webpage and you have the ‘Display all websites
in Compatibility View’ checkbox selected in Tools > Compatibility View
Settings.
If you’re viewing a webpage that is included on the
Microsoft-supplied compatibility view updates list and you have the
‘Include updated website lists from Microsoft’ checkbox selected in
Tools > Compatibility View Settings,
If you’re viewing an intranet page and you have the ‘Display intranet sites in
Compatibility View’ checkbox selected in Tools > Compatibility View Settings.
If you’ve toggled either the ‘Document Mode’ or ‘Browser Mode’ settings
via the Developer Toolbar.
If you’re viewing a page that has declared it’s “ready” for Internet Explorer 8.
My site/browser settings don't fall into any of these categories so I can only presume there's more factors involved.
I'm using the following DOCTYPE in all of my pages,
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
I can force IE to render using the latest version by including,
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
But this doesn't give me the functionality to switch browser modes via the button.
this is to make html5 to work in IE8,9
<!--[if lt IE 9]>
<script src="http://ie7-js.googlecode.com/svn/version/2.1(beta4)/IE9.js" type="text/javascript"></script>
<script src="http://ie7-js.googlecode.com/svn/version/2.1(beta4)/ie7-squish.js" type="text/javascript"></script>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js" type="text/javascript"></script>
<![endif]-->
Hope this will help
If you are indeed including this tag in your page
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
then that is why the button is missing. You've communicated to IE that the site is (supposedly) compatible with its standards rendering mode. Hence it will not display a button to the user for compatibility mode because that would (supposedly) allow the user to accidentally switch the rendering mode, potentially mangling the visual layout of your site.
Ironically, I've often had the opposite problem. The button frequently shows up when I don't want it to. The criteria for whether or not it shows up seems very finicky. Should you every want the opposite behavior (no button being present) I recommend making the above meta tag the first tag of your header.