How to force IE10 to render page in IE9 document mode
Asked Answered
T

9

24

I have two questions:

  1. How can I force IE10 to render in IE9 document mode? Currently it's rendering my page in Standard document mode.

  2. 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" >.

Typhoeus answered 17/1, 2013 at 15:38 Comment(4)
developer toolbar? I assume you mean developer tools. At the top of the window, to the right of the menus is the option to change "Browser Mode". You can also try to add this tag to your <head>: <meta http-equiv="X-UA-Compatible" content="IE=9" >Endosperm
IE10 is causing a lot of headaches for us. Table layout problems suddenly surfaced with tables using width:auto and table-layout:fixedMuffle
We are also having considerable problems with IE10, especially when using third-party plugins.Intercostal
so visual studio 2012 has one snippet , type in metaie8 and press tab twice it will give this meta...:)Fibrilliform
L
32

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.

Ludovika answered 17/1, 2013 at 15:45 Comment(7)
+1 for the answer, but isn't this completely useless? I had a few PC's in our lab which did not load our app at all. After investigation, I realized all these PC's were set to IE7 and even though I used your above meta with content="IE=8" it still chose the PC override instead of the page suggestion. In the end, I don't see how this can help?Zannini
@Zannini - Chances are, the PCs in your lab are connected to a local domain. If that's the case, then the odds are good that that setting is handled by Group Policy, which pretty much trumps all (and even if GP isn't controlling it, the user can still force a different rendering mode via the dev tools). There's only so much you can control from within the web page, but when not locally overridden, the meta tag will work.Ludovika
This response is a bit patronizing - what if you want to just make something work, which you haven't written / can't change. Besides: the <meta> tag should not be self-closed (it doesn't work this way, only a suggestion to use compatibility is displayed). If you write <meta http-equiv="X-UA-Compatible" content="IE=9" > (space before >) it triggers the mode actually.Dustindustman
@TomaszGandor - That depends on your doctype. XHTML requires the end slash, HTML5 allows either way, and HTML4 frowns upon it (but the browsers allow it). Also, technically speaking, <meta http-equiv="X-UA-Compatible"...> isn't actually valid HTML5, anyway, and is restricted to http-equiv=content-type. It's a proprietary tag that should be avoided if at all possible. If you can't change it (though can somehow add the meta tag), then obviously it's not possible to avoid. Without context from the OP, there's no way of knowing that, though.Ludovika
@Ludovika - you're right about the restriction in metas in HTML 5. Even name attribute is subject to limitations, huh. But forget HTML5 validity - I was not arguing about that - I meant that a certain proprietary browser, which has caused many problems in the history of Internet, reacts to this meta tag. And the result was - no triggering of IE9 mode when self-closed or missing the space before >! Which means hurting the w3c validity even for no gain.Dustindustman
@TomaszGandor: Are you sure you didn’t mistype something else? A space before > could be triggering compatibility mode for a very different reason.Duodecillion
Doesn't work in IE11. the meta tag doesn't change document type. What could be wrong?Langobardic
A
9

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.

Abecedary answered 17/1, 2013 at 15:50 Comment(4)
I agree with Paul. I would focus on optimizing your website for IE10 instead of IE9 since it can handle the the newest CSS and HTML code way better.Dogbane
I also agree with this solution but the challenge for me is this application is using lot of third party JSF component like Trinidad Main issue with IE10 standard mode is that it is not able to handle javascript calls from java but we are working on this.. Thanks all for your helpTyphoeus
@Amit: ah, I see. Does IE 9 mode fix that problem?Abecedary
@Dogbane I don't have control over the pages, and the developers don't yet have time to fix compatibility issues, but they might make the time to add a meta tag to certain pages. Alas, I need the Browser mode to be IE9 but the meta tag only sets the document mode and changing the browser mode via F12 Tools is not an option.Aintab
H
8

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.

Handbill answered 17/1, 2013 at 15:44 Comment(0)
F
8

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 :)

Fidellia answered 16/4, 2013 at 9:1 Comment(3)
is the name iexplore.exe or iexplorer.exe?Tisza
Perfect! msdn.microsoft.com/en-us/library/…Graphomotor
Worth noting that it appears that this setting is not retained "through reboots," opted for a quick reg add in Startup.Graphomotor
G
3

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

Gottschalk answered 17/1, 2013 at 15:54 Comment(2)
That's not what I've found. I just successfully used the meta tag on a page that did have a DOCTYPE... but it only works when it's the first tag within head. Hysterical...Tripedal
+1 for the good news. However, as I specified in my answer, it is referred to a preview release of IE10. So, most probably, they have changed this behaviour into the final release.. That said, for what I remember, the meta tag has always been required to be appear as first tag to let the browser knows which rendering mode it was required.Gottschalk
D
2

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...

Dogbane answered 17/1, 2013 at 15:45 Comment(2)
How this will behave for IE8 browser?Typhoeus
If a webpage specifies a document compatibility mode that is not supported by the version of Internet Explorer used to view the webpage, the webpage will be displayed in the highest document mode supported by that version of Internet Explorer. For example, a page that specifies IE9 mode will be displayed in IE8 mode when viewed by Internet Explorer 8.Dogbane
F
1

there are many ways can do this:

add X-UA-Compatible tag to head http response header

using IE tools F12

change windows Registry

Floorboard answered 27/5, 2013 at 5:38 Comment(0)
I
0

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.

Ify answered 25/5, 2013 at 21:10 Comment(0)
P
0

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!

Pinkston answered 5/6, 2013 at 10:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.