简体   繁体   中英

IE8 breaks compatibility view if embedded as an activeX

Using it as a CDHTMLDialog from MFC, I noticed that for some sites (such as wikipedia.org) the embeded IE reports a documentMode property of 7, while using the IE app properly presents the documentMode property as 8. Same thing is true for IE11 too ( documentMode property is 11 when launched standalone and 7 when used embedded). What's going on here ?

IE's Compatibility View Settings determine precedence of how the site is rendered . By default these settings force all intranet sites into Compatibility View regardless of DOCTYPE . You can use X-UA-Compatible which overrides the Compatibility View Settings, so the page will render in standards mode regardless of the browser settings. The X-UA-Compatible meta tag allows you to set which version of Internet Explorer the page should be rendered as. For example, using IE=Edge tell the browsers to render the latest.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM