使用条件确定是否在IE8兼容模式下 [英] Determine if in IE8 Compatibility Mode using conditionals

查看:179
本文介绍了使用条件确定是否在IE8兼容模式下的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从我的研究中了解到IE8确实令人烦恼,例如强迫自己进入本地Intranet主机和本地IP范围的IE7模式。我从上一个问题了解到无法使用条件语句,无论如何无论IE8是在IE8还是IE7模式下呈现,它仍然只会使用<! - [if IE 8]> 条件。

I understand from my research that IE8 does annoying things like forcing itself into IE7 mode for local intranet hosts and local IP ranges. I understand from a previous question that there is no way to use conditional statements as, irrespective of whether IE8 is rendering in IE8 or IE7 mode, it will still only use the <!--[if IE 8]> conditional.

由于这个问题是在前一段时间被问到的(在IE8测试版阶段看起来很糟糕)我想知道这是否已经改变,或者是否还有其他方式使用条件确定IE8是否处于兼容模式。

Since this question was asked a while ago (during the IE8 beta phase by the looks of things) I am wondering if this has changed or if there is any other way using conditionals to determine if IE8 is in compatibility mode.

谢谢!

推荐答案

不,你不能使用条件。

No, you can't do it using conditionals.

最好的方法是使用document.ocumentMode属性,如Pekka发布的链接中所述。 如何检测IE8是否在兼容性方面运行查看?

The best way to do it is to use the document.documentMode property as described in the link Pekka posted. How can I detect if IE8 is running in compatibility view?

这篇关于使用条件确定是否在IE8兼容模式下的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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