简体   繁体   English

IE-在Iframe中阻止兼容模式

[英]IE - Prevent compatibility mode in an Iframe

Is it possible to disable the IE compatibility mode from within an Iframe? 是否可以在iframe中禁用IE兼容模式?

If I use the following meta in the iframe html, this not working: 如果我在iframe html中使用以下元数据,则无法正常工作:

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

It depends on if you have access to the x-ua-compatible meta of the host (parent). 这取决于您是否有权访问主机(父级)的x-ua兼容元。 When the host page is at IE9 mode or above, its state is imposed on the iframe. 当主机页面处于IE9模式或更高版本时,其状态将施加在iframe上。 Here's a good explanation, given by a moderator at MS-Connect. 这是一个很好的解释,由MS-Connect的主持人给出。

https://connect.microsoft.com/IE/feedback/details/1047106/when-webpage-emulates-ie-5-embedded-iframe-shows-ie-8 https://connect.microsoft.com/IE/feedback/details/1047106/when-webpage-emulates-ie-5-embedded-iframe-shows-ie-8


Here's supplemental info about how Quirks mode forked two ways beginning with IE10. 这是有关Quirks模式如何从IE10开始分叉的两种补充信息。

https://msdn.microsoft.com/library/hh869300(v=vs.85).aspx https://msdn.microsoft.com/library/hh869300(v=vs.85).aspx


Here's a live demo which allows changing the IE modes on-the-fly. 这是一个实时演示,可以即时更改IE模式。
It was patched to also allow selecting the iframe url. 已对其进行了修补,以允许选择iframe网址。

https://googledrive.com/host/0B8BLd2qPPV7XfnZQRk1JSkg5cFVMbGI1QkZVclVBbUtWZnV2bmczUHpSaVJmSXBOdUg2ek0/toggle-IE-compat-and-quirks-modes.html https://googledrive.com/host/0B8BLd2qPPV7XfnZQRk1JSkg5cFVMbGI1QkZVclVBbUtWZnV2bmczUHpSaVJmSXBOdUg2ek0/toggle-IE-compat-and-quirks-modes.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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