By default IE8 forces intranet websites into compatibility mode. I tried changing the meta header to IE8, but it doesn't acknowledge the meta header and just uses the browser setting. Does anyone know how to disable this?
相关问题
- How to fix IE ClearType + jQuery opacity problem i
- Is TWebBrowser dependant on IE version?
- Javascript does not work in IE8
- IE dropdown z-index bug
- Multiple cookies with same name
相关文章
It is possible to override the compatibility mode in intranet.
For IIS, just add the below code to the web.config. Worked for me with IE9.
Equivalent for Apache:
And for nginx:
And for express.js:
If you pull down the "Tools" menu and choose "Compatibility View Settings" On that dialog at the bottom is a setting "Display intranet sites in compatibility mode". If you uncheck this that should resolve the problem and IE will use the mode based on the DOCTYPE.
This question is a duplicate of Force "Internet Explorer 8" browser mode in intranet.
The responses there indicate that it's not possible to disable the compatibility view (on the server side) - https://stackoverflow.com/a/4130343/24267. That certainly seems to be the case, as none of the suggestions I've tried have worked. In IE8 the "Browser Mode" gets set to Internet Explorer 8 Compatibility view no matter what kind of X-UA-Compatible header you send.
I had to do some special handling for IE7 and compatibility mode, which caused the browser to render using IE8 but report it was IE7, broke my code. This is how I fixed my code (I am aware this is a horrible hack and I should be testing for features not browser versions):
Add this inside your pages head tag (targeting the IE version you want):
Note, this will NOT change the fact that the browser says its in compatibility mode (called the browser mode), but the page will render in IE8 standards mode. If its STILL not rendering how you wish, its probably because you have javascript that is erroneously checking the I.E. version. See the following blog post to determine which property you should be keying off of because even if you set the meta X-UA-Compatible tag, the user agent string will still say MSIE 7.0.
In my case, for the fix I had to add a check for IE7 Compatibility mode. I did so using a simple javascript code:
Our system admin resolved this issue by unchecking the box globally for our organization. Users did not even need to log off.
We can resolve this problem in Spring-Apache-tomcat environment by adding one single line in RequestInterceptor method -
Reference from - How to create filter and modify response header It covers how we can resolve this problem via a RequestInterceptor (Spring).