Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set document mode to Edge in IE11 Win8.1

The last year, I've created some html5 (with some php in, but that's not relevant I think) websites and everything went well in Internet Explorer 10, Chrome, Firefox....

But last week, my boss orderd a new pc with Windows 8.1 on it, and ofc. IE 11, and all my websites look ugly. I checked with F12 tools and on the emulation tab, it says Documentmode = 7 (default). If I change it to Edge, everything shows as it should be....but after a refresh it just jumps back to 7.

I always used <!DOCTYPE html> on top of my pages and always worked in the past. But now, IE11 on win8.1 seems to ignore it. The reason why I think it's Windows 8(.1) only is because I have also IE11 installed, but on a Windows7 PC. I double checked and there are no websites added to the list for compabilityview on both PC's

After some searching I found <meta http-equiv="X-UA-Compatible" content="IE=edge" /> and it works!

But I can't find anywhere why it is like this and if there is another solution instead of opening every page of every website I've created and adding the meta-tag...

My first question here, hope I did well :-)

like image 551
diedie2 Avatar asked Dec 12 '13 09:12

diedie2


People also ask

How do I change the default document mode in IE11?

From the Settings dropdown, select F12 Developer Tools. Select the Emulation tab. Select Edge (Default) from the Document mode drop down. Select Default from the User agent string drop down.


2 Answers

Where is the site being served from? Is it on your local network/intranet? I seem to remember that IE defaults to compatibility mode for sites in the "Intranet Zone". So this shouldn't happen to users accessing it from the outside world. See http://msdn.microsoft.com/en-us/library/jj676914%28v=vs.85%29.aspx

You can send X-UA-Compatible as a server header, instead of changing every page of every site. See http://msdn.microsoft.com/en-us/library/jj676913%28v=vs.85%29.aspx

like image 60
Olly Hodgson Avatar answered Sep 23 '22 21:09

Olly Hodgson


This is how I fixed my issue. Works great.

<system.webServer>
    <httpProtocol>
        <customHeaders>
            <clear />
            <add name="X-UA-Compatible" value="IE=edge" />
        </customHeaders>
    </httpProtocol>
like image 33
Don Rolling Avatar answered Sep 25 '22 21:09

Don Rolling