Disable Compatibility View Through Code In IE?

╄→尐↘猪︶ㄣ 提交于 2019-12-04 03:10:28
Sologoub

Here's the documentation you are looking for: http://msdn.microsoft.com/en-us/library/cc288325(v=vs.85).aspx

Include this and IE will render as in IE9 mode:

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

By default, IE will render in compatibility mode for websites on the same subnet as the client. You can fix this by either turning off this feature in IE by going to Tools->Compatibility View Settings and unchecking Display Intranet sites in compatibility mode, or by including the meta tag that Sologoub mentioned.

longga

I have this issure too. And I found a solution :

insert meta tag in header HTML:

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

and set the equivalant header:

header('X-UA-Compatible: IE=Edge');

Or if you use Zend Framework (or any framework for that matter), something like this will do Zend_Controller_Front::getInstance()->getResponse()->setHeader('X-UA-Compatible', 'IE=Edge');

solution in this link :

http://www.enrise.com/2012/03/internet-explorer-9-compatibility-view-list/

Thanks.

Sometimes you need to be a bit more comprehensive so that you target all the possible user overrides. Certainly for single-page apps like Meteor:

<meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7; IE=EDGE; Chrome=1" />

Hope this helps.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!