IE - Prevent compatibility mode in an Iframe

2019-05-26 10:39发布

Is it possible to disable the IE compatibility mode from within an Iframe?

If I use the following meta in the iframe html, this not working:

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

1条回答
女痞
2楼-- · 2019-05-26 10:46

It depends on if you have access to the x-ua-compatible meta of the host (parent). When the host page is at IE9 mode or above, its state is imposed on the iframe. Here's a good explanation, given by a moderator at MS-Connect.

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.

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


Here's a live demo which allows changing the IE modes on-the-fly.
It was patched to also allow selecting the iframe url.

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

查看更多
登录 后发表回答