尝试在使用 IE=EmulateIE7 的页面上的 iframe 中使用 IE=edge X-UA-Compatible [英] Trying to use IE=edge X-UA-Compatible in an iframe on a page using IE=EmulateIE7

查看:14
本文介绍了尝试在使用 IE=EmulateIE7 的页面上的 iframe 中使用 IE=edge X-UA-Compatible的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个页面将包含在他们使用以下内容的页面上的 iframe 中:

I have a page that's going to be included in an iframe on a page where they use the following:

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

理想情况下,我想使用用户正在使用的浏览器可用的最新标准模式来呈现我的页面.这可能吗?

and ideally I'd like to render my page in using the latest standards mode available to the browser the user is using. Is this possible?

我试过包括

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

在我的页面上,以及更改我的 web 应用程序以包含值为 'IE=edge' 的 'X-UA-Compatible' HTTP 标头,但我似乎无法让它做我想做的事情.

on my page, as well as altering my webapp to include the 'X-UA-Compatible' HTTP header with value of 'IE=edge', but I can't seem to get it to do what I want.

奇怪的是,例如,如果我有两个页面,第一个包含 iframe,另一个是显示在 iframe 中的内容,如下所示:

The odd thing is, is that if for instance I have two pages, the first containing the iframe and the other being what's displayed in the iframe, like so:

<!doctype html>
<html>
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"/>
    <script>
        console.log("Page document mode: "+document.documentMode);
    </script> 
</head>  
<body>
<iframe src="iframepage.html" /> 
</body>
</html>

<!doctype html>
<html>
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <script>
        console.log("Iframe document mode: "+document.documentMode);
    </script> 
</head>
<body>
</body>
</html>

结果出乎意料

Page document mode: 7
Iframe document mode: 8

文档模式8从何而来?还有怎么把iframe文档变成9以上??

Where has the document mode 8 come from? And how do I make the iframe document into 9 or above??

如果有人能指出我正确的方向,我将永远感激!!谢谢,尼克

I'd be eternally grateful if someone can point me in the right direction!! thanks, Nick

推荐答案

IE 不允许在框架层次结构中混合使用 IE9+ 和旧模式.如果您的顶级文档是 IE7,那么您可以在任何内部文档中获得的最高文档是 IE8.同样,您将无法在 IE9 模式页面内托管除 IE9 模式文档之外的任何内容.

IE does not allow mixing IE9+ and older modes in a frame hierarchy. If your top document is IE7, the highest you can get in any inner document is IE8. Similarly, you wouldn't be able to host anything but IE9 mode docs inside an IE9 mode page.

这篇关于尝试在使用 IE=EmulateIE7 的页面上的 iframe 中使用 IE=edge X-UA-Compatible的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆