Force Browser and Document Mode to ie9 in ie10

北城余情 提交于 2019-11-30 17:35:34

问题


This code:

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

seems to only change document to ie9 and not browser. Any ideas other than hitting F12 and changing it manually?


回答1:


A site can not set the Browser mode. The browser mode is chosen before the browser requests content from the site. This specifies how the browser is identified to the site, such as the UA string.

As you mentioned, the Document mode can be set by the author by including a X-UA-Compatible meta element, or by the DOCTYPE used. This overrides the default set by the browser for that browser mode.

Changing the Browser Mode is only useful for using IE to test how an earlier version of IE would handle the site. You can change it on your local machine (but not for the site as a whole) by changing it in the F12 tool.

The user (and thus developer) can change the Browser mode by clicking on the Compatibility View icon in the URL field. This will also be only for that machine, and not for all users.

The only way to change the Browser mode globally is to get the site added to MS’ Compat View List. But you don’t want that unless the site uses a ton of old MS vendor specific code, and will not be updated.

You can read more at http://blogs.msdn.com/b/ie/archive/2010/10/19/testing-sites-with-browser-mode-vs-doc-mode.aspx




回答2:


Optionally, you can alter the Web.config file to accomplish this as well. (You'll have to restart the service after publishing to see the changes.)

<system.webServer>
    <httpProtocol>
      <customHeaders>
        <add name="X-UA-Compatible" value="IE=Edge" />
      </customHeaders>
    </httpProtocol>
</system.webServer>



回答3:


You can use the FEATURE_BROWSER_EMULATION feature of Internet explorer.

Start regedit.exe, go to

HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION

or

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION

create a DWORD iexplore.exe and set the value to 9999 (0x270F).




回答4:


see this.

you can force highest mode by adding:

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


来源:https://stackoverflow.com/questions/15838605/force-browser-and-document-mode-to-ie9-in-ie10

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