如何检测IE8是否在兼容性视图下运行? [英] How can I detect if IE8 is running in compatibility view?
问题描述
有没有确定IE8浏览器是否启用兼容性视图?
Is there anyway to determine if an IE8 browser has compatibility view switched on?
我似乎没有在Google上找到任何东西,所以我想知道这是否是一个可用的信息...
I can't seem to find anything on Google, and so I'm wondering if this is a piece of information that is available...
为什么你问!我试图跟踪我们的应用程序中的错误。我通过Elmah日志拼接,似乎有一种趋势;这个错误通常被IE8抛出。我试图在IE8的副本中回收缺陷,但是不能。我想缩小罪魁祸首,并认为这可能是一种方式。
Why you ask!? I'm trying to track down a bug in our application. I'm piecing through the Elmah logs and there seems to be a trend; this error is generally thrown by IE8. I tried to repo the defect in my copy of IE8, but couldn't. I want to narrow down the culprits, and thought this might be a way to do it.
推荐答案
在Javascript中,使用文档。 documentMode
In Javascript, use document.documentMode
请参阅 http://msdn.microsoft.com/en-us/library/cc196988%28VS.85%29.aspx 了解详情。
这篇关于如何检测IE8是否在兼容性视图下运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!