强制IE9进入Quirks模式? [英] Force IE9 into Quirks mode?

本文介绍了强制IE9进入Quirks模式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带iframe的页面,而iframe包含需要以怪异模式运行的代码(它是Microsoft的Outlook Web Access,因此我们无法修复我们的代码)。 IE9引入了一个功能,当父框架处于IE9文档模式时,它还强制任何iframe进入相同的文档模式。这打破了我们拥有iframe的代码。

I have a page with an iframe, and the iframe contains code that needs to run in quirks mode (it's Microsoft's Outlook Web Access, so it's not our code that we could fix anyway). IE9 introduced a "feature" that when the parent frame is in IE9 document mode, it also forces any iframes into the same document mode. This breaks the code we have an the iframe.

我希望这是IE9中的一个错误,但我的票被拒绝为按设计(这是票证如果你想看看)

I was hoping this was a bug in IE9, but my ticket was turned down as "by design" (here is the ticket if you care to look)

我不能以怪癖模式运行整个网站,但我只需要在这个页面上进行。有没有办法以编程方式打开怪癖模式渲染?无论是那种,还是模仿按下兼容性视图按钮的方式 - 按下这几乎可以将IE9变成IE8,它也可以正常工作。

I can't run the entire site in quirks mode, but I need it to happen only on this page. Is there a way to programmatically turn on quirks mode rendering? Either that, or a way to emulate pressing the "compatibility view" button - pressing this pretty much turns IE9 into IE8, which works just fine as well.

是否有可能做这些事情中的任何一个?

Is it possible to do either of these things?

推荐答案

我有同样的问题,并在2011年4月进行了相当广泛的研究。从那时起,在IE9中以标准模式获得顶级文档和在怪癖模式中使用子iframe的文档的唯一方法是使用元标记使浏览器的行为就像它是IE8一样。 (据我所知,情况仍然如此,微软无意改变它。)你可以使用各种各样的元标记来改变浏览器模式,但我使用的那个有用的是:

I had your same issue and researched it fairly extensively back in April 2011. As of then, the only way to have a top-level document in "standards mode" and a document in a child iframe in "quirks mode" in IE9 was to use a meta tag to have the browser behave as if it were IE8. (As far as I know, this is still the case and Microsoft has no intention to change it.) There are a variety of meta tags you can use to change browser mode, but the one I have used that has worked was:

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

如果包含此元标记,则应根据IE8规则正确呈现所有文档(根据IE8规则)他们的doctype。

If you include this meta tag, all of the documents should be properly rendered (per IE8 rules) according to their doctype.

但请注意,这使您无法使用IE9中任何新支持的css功能,即使在顶级文档中也是如此。你将无法使用border-radius,box-shadow,opacity等。

Note, however, that this precludes you from using any of the newly supported css features in IE9, even in the top-level document. You won't be able to use border-radius, box-shadow, opacity, etc..

在怪癖模式下会出现iframe渲染吗?,这会在ie中询问关于iframe和doctypes的更一般的问题。 。

There's some more info on this at Will an iframe render in quirks mode?, which asks a more general question about iframes and doctypes in ie.

这篇关于强制IE9进入Quirks模式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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