简体   繁体   English

尝试使用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

I have a page that's going to be included in an iframe on a page where they use the following: 我有一个页面将包含在页面上的iframe中,他们使用以下内容:

<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? 这可能吗?

I've tried including 我试过包括

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

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. 在我的页面上,以及改变我的webapp以包含'X-UA-Compatible'HTTP标头,其值为'IE = edge',但我似乎无法让它做我想要的。

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: 奇怪的是,如果我有两个页面,第一个包含iframe,另一个是iframe中显示的内容,如下所示:

<!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>

and

<!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>

The output is the rather unexpected 输出是相当意外的

Page document mode: 7
Iframe document mode: 8

Where has the document mode 8 come from? 文档模式8来自何处? And how do I make the iframe document into 9 or above?? 如何将iframe文档制作成9或以上?

I'd be eternally grateful if someone can point me in the right direction!! 如果有人能指出我正确的方向,我将永远感激不尽! thanks, Nick 谢谢,尼克

IE does not allow mixing IE9+ and older modes in a frame hierarchy. IE不允许在帧层次结构中混合IE9 +和旧模式。 If your top document is IE7, the highest you can get in any inner document is IE8. 如果您的顶级文档是IE7,那么任何内部文档中可以获得的最高级别是IE8。 Similarly, you wouldn't be able to host anything but IE9 mode docs inside an IE9 mode page. 同样,除IE9模式页面内的IE9模式文档外,您将无法托管任何内容。

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

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