IE文档模式在不同服务器上具有不同的默认值 [英] IE Document Mode has different defaults on different servers

查看:106
本文介绍了IE文档模式在不同服务器上具有不同的默认值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个HTML应用程序,我最初的目标是IE7,因为公司的一半仍然有这个特定的版本。他们刚刚升级到IE8,我试图摆脱任何IE7特定的代码。

查看本地服务器上的主页,文档模式设置为IE8标准。如果我在我的测试服务器上查看相同的确切代码库,它默认为IE7标准:



这是我在每台服务器上查看开发人员工具时看到的内容:

http:// localhost:12345 /

浏览器模式:IE8

文件模式: IE8标准(页面默认)

http:// webtest01 /

浏览器模式:IE8兼容查看

文档模式:IE7标准(页面默认)



导致它们在不同服务器上有所不同?

编辑

我认为这是因为Internet Explorer有一个设置来显示兼容性视图中的本地Intranet网站。是否有一个标签,我可以用它来覆盖这个为我的网站?

解决方案

IE is puts webtest01 在本地Intranet区域中,这会强制IE8 Compat浏览器模式/ IE7模式文档模式。

相信,您可以添加 X-UA兼容 HTTP头(或< meta> 标记,只要它是头部的第一个标记),它应该将文档模式转换为IE8标准,但无法修复浏览器模式一个href =https://stackoverflow.com/a/2745477/201952>对脚本的微妙影响。



为了让IE脱离兼容性浏览器模式,您必须转到Internet选项>服务>本地Intranet>站点,并确保所有内容都未选中,或转到工具>兼容查看选项并取消选中Di在兼容性视图中展示Intranet站点。


I am developing an HTML application and I was originally targeting IE7 because half of the company still had that particular version. They just upgraded to IE8 this week and I'm trying to get rid of any IE7 specific code.

One thing I noticed while using the IE developer tools is that when I view the home page on my local server, the Document Mode is set to IE8 Standards. If I view the same exact code base on my test server, it defaults to IE7 standards:

This is what I see when I look at developer tools on each server:

http://localhost:12345/
Browser Mode: IE8
Document Mode: IE8 Standards (Page Default)

http://webtest01/
Browser Mode: IE8 Compat View
Document Mode: IE7 Standards (Page Default)

What is causing them to be different on different servers?

EDIT
I think it is because Internet Explorer has a setting to display Local Intranet sites in Compatibility View. Is there a tag I can use to override this for my site?

解决方案

IE is puts webtest01 in the Local Intranet Zone, which forces IE8 Compat browser mode/IE7 mode document mode.

I believe you can add a X-UA-Compatible HTTP header (or <meta> tag, so long as it's the first tag in your head), which should get the document mode into IE8 standards, but cannot fix browser mode, which has subtle implications for scripts.

To get IE out of compatibility browser mode, You have to go to Internet Options > Sercurity > Local Intranet > Sites and make sure everything is unchecked, or go to Tools > Compatibilty View Options and uncheck Display intranet sites in Compatibility View.

这篇关于IE文档模式在不同服务器上具有不同的默认值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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