当页面包含页面时,iframe不会以ie9模式呈现在怪癖模式下 [英] iframe not rendering in ie9 mode when containing page is in quirks mode

查看:252
本文介绍了当页面包含页面时,iframe不会以ie9模式呈现在怪癖模式下的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在一个以怪癖模式运行的页面中有一个iframe(我无法控制包含页面),我需要我的页面以与现代浏览器功能兼容的模式呈现。



包含的页面大量使用了较新的JavaScript特性(尤其是漂亮的数组函数)和SVG渲染。虽然我可以轻松地将数组函数填满,但我无法强制svg呈现。



要清楚,内页不会以怪癖模式运行 - I已经指定了文档类型并且ie = edge< meta>标签。它看起来像是在使用ie8渲染模式(难以确定)



问题的一个示例在这里: http://stevesspace.com/quirks/quirks.html - 在chrome中加载它以查看预期的输出,以及检查它在IE9或10的实际输出。编辑:我已经添加了文档模式和兼容模式的样本,我可以确认它使用IE8文档模式。

解决方案

我最终使用了一个对象标记而不是iframe,它在现代浏览器中似乎可以正常工作。 >

 < object type =text / htmldata =http://example.com>< / object> 

事实证明,您不能在IE9中使用JavaScript修改网址,但这不是什么大不了的事情 - 删除/添加一个新的对象元素也适用于此。



更新:
此标签也可以位于iframe指向的中间页面,它可以正常工作
更新2:
此解决方案在IE10中无效


I have an iframe in a page that runs in quirks mode (I don't have control over the containing page), and I need my page to render in a mode that is compatible with modern browser features.

The contained page makes heavy use of newer JavaScript features (especially the nice array functions), and SVG rendering. While I can shim the array functions easily enough, I can't force the svg to render.

To be clear, the inner page is NOT running in quirks mode - I have specified a doctype and the ie=edge < meta > tag. It looks like it's using the ie8 rendering mode (hard to be certain)

A sample of the issue is here: http://stevesspace.com/quirks/quirks.html - load it up in chrome to see the expected output, and check it in IE9 or 10 for the actual output.

EDIT: I've added the document mode and compatibility mode to the sample, I can confirm it's using IE8 doc mode.

解决方案

I ended up using an object tag instead of an iframe, it seems to work ok across modern browsers.

<object type="text/html" data="http://example.com"></object>

It turns out you can't modify the URL using javascript in IE9, but that's not a big deal - removing/adding a new object element works just as well for this.

Update: This tag can also be in an intermediate page that the iframe points to and it all works fine Update 2: This solution does not work in IE10

这篇关于当页面包含页面时,iframe不会以ie9模式呈现在怪癖模式下的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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