22

We've run into an unusual bug with Internet Explorer and we need to force IE 11 to behave as IE 10 (since this bug is not present in IE 10).

I have tried the following:

    <meta http-equiv="x-ua-compatible" content="IE=10">

but unfortunately this does not work and I have not found anything relevant or helpful from Google searches or the docs. So how do we get IE 11 to behave as IE 10?

Marco Demaio
  • 33,578
  • 33
  • 128
  • 159
jAsOn
  • 927
  • 2
  • 7
  • 16
  • 5
    Why not just fix the bug? (or at least check what version the user is using) – Sayse Sep 03 '13 at 09:34
  • 2
    Since IE11 is still only a preview release, what makes you think this bug won't be fixed before release? –  Sep 03 '13 at 09:35
  • 3
    Because it's not MY bug, like I said in the question, it's an IE BUG. – jAsOn Sep 03 '13 at 09:38
  • 9
    @MikeW My client has many customers who are already using IE 11 and it's preventing them from Logging in, Signing Up and Ordering products. Every other version of IE and every other browser works perfectly with the site. _**Excuse me** for trying to do something about it._ And I know it might be fixed before release, but if there's a way to work around it _now_, why not? It can always be updated later on _if_ they do fix it. – jAsOn Sep 03 '13 at 09:40
  • 2
    I'm curious as to what the bug is. Also, I'm not sure if having IE11 pretend to be IE10 will get rid of the bug. – Mr Lister Sep 03 '13 at 09:41
  • I've already tested this manually by forcing it to emulate IE 10 and it works perfectly. Now I just need a way to do it for them. – jAsOn Sep 03 '13 at 09:42
  • Oh, OK. Have you tried `"IE=EmulateIE10"` instead of "IE=10"? – Mr Lister Sep 03 '13 at 09:43
  • @MrLister thank you. I updated it with `IE=EmulateIE10` but it's not emulating IE 10. – jAsOn Sep 03 '13 at 09:57
  • Then I don't have an answer, sorry. – Mr Lister Sep 03 '13 at 10:00
  • Where, exactly, did you put the META tag in question? What do you see in the F12 Developer Tool's Console tab as the page loads? – EricLaw Sep 03 '13 at 20:28
  • @EricLaw I put the meta directly under the , and when I look in Dev tools as the page loads and after the page loads everything is set to Default (which are the settings it uses when there is no meta being used). – jAsOn Sep 04 '13 at 05:29
  • Providing a live URL or the complete contents of the top of the page will help folks debug this. Keep in mind that setting `X-UA-Compatible` has no impact on the `User-Agent` sent to the server, so if your server mishandles that (as unpatched ASP.NET does) doing so will not help anyway. – EricLaw Feb 12 '14 at 14:18

6 Answers6

35

Do the following:

  1. The correct meta string is: <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE10"/> (I added it just below the <title>. Preserve case, IE crappy code might be also case sensitive.)

  2. And a valid <!DOCTYPE... must be present at the very 1st line of your page (no space or lines before it)

You can verify if it works by hitting F12 to show the IE11 developer tools. On the left side there is a grey bar, scroll it down and select Emulation, if it shows Document mode: IE10 it will be fine!

Brian Pipa
  • 808
  • 9
  • 23
Marco Demaio
  • 33,578
  • 33
  • 128
  • 159
  • 2
    `IE crappy code might be also case sensitive` that's a good one. – Mahmood Dehghan Jan 24 '16 at 10:40
  • 3
    The dev console told me it switched to IE 10 emulation mode, however, the website still not worked (as it did under IE 10 emulation mode when it was manually set in the dev console). **It worked when I put the `` tag as the first tag in ``.** – ComFreek Mar 19 '16 at 14:00
  • if there's a flash in web page, it doesn't re-render that flash. You have to press F12 to avticate re-render of that flash. So basically, no solution for flash part in web page. I've already put meta as first tag in head, too. – Scott Chu Mar 15 '18 at 06:06
12
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE10">

Should work.

I know this will not set IE11 to IE10 mode but it might me worth a shot to try the edge setting.

<meta http-equiv="X-UA-Compatible" content="IE=edge">

This flow chart shows how the document mode works. The image is from the Microsoft MSDN site. http://msdn.microsoft.com/en-us/library/ff955275%28v=vs.85%29.aspx

Another useful link MSDN IE document modes http://msdn.microsoft.com/en-us/library/ff406036(v=vs.85).aspx

enter image description here

Xm7X
  • 861
  • 1
  • 11
  • 23
6

I just had the same problem. Its as if the x-ua-compatible tag does not change the document mode unless its the first meta tag in the header. I had a script tag above it.

If you put the meta tag you tried as the first tag in the header and press F12, you will see the document mode stays on 10.

Helo
  • 1,004
  • 11
  • 15
1

This may help you to set response header with IIS: http://msdn.microsoft.com/en-us/library/ff955275(v=vs.85).aspx

Hi10
  • 531
  • 1
  • 5
  • 21
  • Thanks @Hi10, I just updated the site with `IE=EmulateIE10` but it doesn't emulate. – jAsOn Sep 03 '13 at 10:01
  • If you look at the table of content from shared link. you need to have in your HTML..... IE10 mode (if a valid declaration is present) Quirks mode (otherwise) – Hi10 Sep 03 '13 at 12:18
0

I also tried this, it doesn't works for me

<meta http-equiv="x-ua-compatible" content="IE=10">

also its works well if i manually change Useragentstring in F12 IE console to IE10,

I got a solution here below and its works for me, now my pages works properly in IE11 without changing anything in my code

Refer this https://stackoverflow.com/a/20422240/2089963

Community
  • 1
  • 1
Syed Mohamed
  • 1,339
  • 1
  • 15
  • 23
  • 1
    Setting `X-UA-Compatible` has no impact on the `User-Agent` header sent to the webserver, which is why you found that you needed to correct the server not to mishandle IE11's `User-Agent` string. – EricLaw Feb 12 '14 at 14:17
  • i saw it changes only DocumentMode only – Syed Mohamed Feb 12 '14 at 14:52
0

Setting in we.config:

<system.webServer>
    <httpProtocol>
        <customHeaders>
            <clear/>

            <add name="X-UA-Compatible" value="IE=EmulateIE9"/>
        </customHeaders>
    </httpProtocol>

ahaliav fox
  • 2,217
  • 22
  • 21