gpt4 book ai didi

html - 如何在 IE 9 的 iframe 中为 doctype 指定 QuirksMode?

转载 作者:太空狗 更新时间:2023-10-29 13:52:17 24 4
gpt4 key购买 nike

问题:

我们有一个门户网站,其中的文档类型与 xhtml 1.0 兼容。然后,在门户中,我们有一个内容 iframe,我们在其中嵌入了不同的 Web 应用程序。其中一些应用程序是我们编写的,一些是第 3 方。

现在,在该 iframe 中,我们嵌入了 Microsoft Reporting Service 报告等内容。问题是,Reporting Service Reports 需要 QuirksMode 才能“正确”呈现。门户在 QuirksMode 下不起作用(就我而言,这很好,因为我们只针对 9,可能还有 IE8)。该门户在 IE7 中也无法正常呈现,我们将尽快放弃对 IE8 的支持。

但是,IE9 似乎继承了父页面的文档模式,因此报告服务报告以 IE9 标准模式而不是 quirks 模式呈现。所以所有的报告都显示不正确(我不是一点点的意思,真的很严重,完全不正确,绝对可怕)

问题是,我们无法更改报告服务...
无法使报告服务(任何版本)呈现非 quirksmode HTML。

根据 Will an iframe render in quirks mode?我可以添加

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

让 iframe 在 QuirksMode 中呈现。(编辑:当我不关心门户如何呈现并将其放入时甚至不起作用)

不幸的是,门户如前所述,不兼容 IE7,因此这不是一个选项。
此外,SSRS 报告在门户之外的另一个域上运行,因此我无法以任何方式使用 JavaScript/jQuery。

有什么方法可以在不破坏父页面布局的情况下在 QuirksMode 中呈现 iframe 吗?
或者(已经存在的)使报告服务呈现有效 HTML 的方法(我当然没有时间编写自定义 HTML 呈现扩展)?

最佳答案

通过MSDN :

Although the newer rendering engine is only used when Windows® Internet Explorer® detects that an HTML page has requested the highest level of support for standards, the same is not always true for child pages that might be loaded within frame and iframe elements. Because only one rendering engine can be active at a time, IE9 Mode also includes emulation for Quirks Mode.

对不起,你想做的事情在IE9中是不可能实现的。

关于html - 如何在 IE 9 的 iframe 中为 doctype 指定 QuirksMode?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12277841/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com