Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
311 views
in Technique[技术] by (71.8m points)

html - Internet Explorer 11 disable "display intranet sites in compatibility view" via meta tag not working

I have been working on an intranet website for over 6 months were I have been using the below html5 doctype and edge compatibility meta tag to force Internet Explorer to not emulate an older browser version, and this has worked ok.

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <title>My title</title>
    <meta http-equiv="X-UA-Compatible" content="IE=EDGE" />
</head>
<body>
</body>
</html>

The reason I was doing it this way is because the place I work uses a policy setting to enable compatibility view for all intranet sites, and this approach using the EDGE setting has worked in Internet Explorer 9.

Intranet site compatibility view setting

Over a month ago I was upgraded to Internet Explorer 11 and the site still worked as expected.

Today this stopped working as expected, I can't say for sure but I think that the policy that forces the compatibility view was not enabled in IE11 and now it is... and since this has been enabled the compatibility meta tag is no longer doing what is expected, and this site is being run in the Enterprise mode which emulates IE8.

Does anyone know how to fix this and force IE11 to be used on an intranet site when the compatibility "Enterprise mode" is being enforced? and can't be disabled via the browser settings?

EDIT

I have just tried adding a custom header in my web.config as explained in this answer https://stackoverflow.com/a/18257208/98706

and this did not work for me I still get the below message in the developer toolbar console of

HTML1122: Internet Explorer is running in Enterprise Mode emulating IE8.

It is as if version 8 is being treated as the edge when this intranet compatibility setting is enabled in IE11.

This post: https://www.leapinggorilla.com/Blog/Read/1016/ie-ate-my-css---disabling-compatability-mode explains this well, I haven't yet tried setting this header via code and our users dont have access to change their browser settings.. none of the other changes have worked as yet.

UPDATE

Please see my comment on this post about what the difference between Enterprise mode and compatibility mode is, because it is important.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Make sure:

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

is the first <meta> tag on your page, otherwise IE may not respect it.

Alternatively, the problem may be that IE is using Enterprise Mode for this website:

  • Your question mentioned that the console shows: HTML1122: Internet Explorer is running in Enterprise Mode emulating IE8.
  • If so you may need to disable enterprise mode (or like this) or turn it off for that website from the Tools menu in IE.
  • However Enterprise Mode should in theory be overridden by the X-UA-Compatible tag, but IE might have a bug...

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...