来自Apache检测IE版本,在兼容模式的情况下 [英] Detect IE version from Apache, in case of compatibility mode

查看:342
本文介绍了来自Apache检测IE版本,在兼容模式的情况下的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果一个网页是从本地Intranet区域网站检索,使用IE7模式。 - MSDN

If a webpage is retrieved from a website in the Local intranet zone, IE7 mode is used. -MSDN

所以,这与我们发生了什么。客户已将该选项设置为用兼容模式打开Intranet站点。因此,在他们的地方我们的应用程序加载在IE7模式。

So that's what happening with us. Client has set the option to "open intranet sites in compatibility mode". So at their place our application loads in IE7 mode.

有什么办法通过该客户端是否在运行IE他在兼容模式下我能察觉?

Is there any way by which I can detect whether the client is running his IE in compatible mode?

据我所知,如果浏览器在兼容模式下然后将其发送IE7​​用户代理字符串到Apache。所以,我可以得到的文档模式是IE7,但我无法验证它是否是他的家乡IE7或者兼容的。

As far as I know if the browser is in compatible mode then it sends IE7 user-agent string to Apache. So I can get that document mode is IE7, but I can't verify whether it's his native IE7 or the compatible one.

任何人有任何想法的如何从Apache的检测精确的IE浏览器版本,并检测它是否兼容模式或本机模式

Anyone has any idea on how to detect the exact IE browser version from Apache and to detect whether it is in compatible mode or native mode?

推荐答案

下面是IE浏览器的用户代理字符串显示兼容模式。

Here are user agent strings for IE that show the compatibility modes.

IE7: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1;...)
IE8: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0;...)
IE8 Compatibility View: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/4.0;...)
IE9: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)
IE9 Compatibility View: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/5.0;...)
IE10 Compatibility View Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.2; WOW64; Trident/6.0;...
IE11 Compatibility View : Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.3; Trident/7.0...)

,以确定它是否是这样的本地IE7 8 9 在兼容模式下运行的是,IE8和IE9也将包含三叉戟字符串。

The way to determine if it is native IE7 or 8 and 9 running in compatibility mode is that IE8 and IE9 will also contain the Trident string.

所以,如果你在Apache中做一个USER_AGENT检查,为 MSIE 7.0 ,它也包含三叉戟/ 4.0 然后这是 IE8 IE7兼容模式下运行

So if you do a user_agent check in apache, for MSIE 7.0 and it also contains Trident/4.0 Then it's IE8 running in IE7 compatibility mode.

同样的, IE9 。如果它既有 MSIE 7.0 三叉戟/ 5.0 那么它的 IE9 在IE7兼容模式下运行。

Same with IE9. If it has both MSIE 7.0 and Trident/5.0 then it's IE9 running in IE7 compatibility mode.

否则,它USER_AGENT串而 MSIE 7.0 那么它的原生IE7。

Otherwise, it the user_agent string only has MSIE 7.0 then it's native IE7.

这可能是由USER_AGENT的唯一途径。希望有所帮助。

That is probably the only way by user_agent. Hope that helps.

这里更多的信息。

http://msdn.microsoft .COM / EN-US /库/ IE / hh869301(v = vs.85)的.aspx

另外这里是一个很好的清单了。
http://www.useragentstring.com/pages/Internet%20Explorer/

Also here is a nice list too. http://www.useragentstring.com/pages/Internet%20Explorer/

这篇关于来自Apache检测IE版本,在兼容模式的情况下的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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