IE8 黑名单域强制非标准模式

发布于 2024-09-07 03:03:02 字数 757 浏览 5 评论 0原文

我在符合标准的页面上对 IE 8 进行了一些测试,具有严格的文档类型:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

但是,显然该页面是在“IE 8 兼容视图”/“IE7 标准”中呈现的,这破坏了布局。
环顾四周后,我发现 IE 显然有一个网站黑名单,强制列出的网站采用兼容模式。
然后,我检查了 此黑名单域数据库 我正在处理的网站是否在列表中,但它不在列表中't。这是一个很大的网站,而且数据库定义似乎已经过时了,所以它可能是在去年左右添加的。

在另一个域上测试完全相同的页面会触发 IE8 的标准模式,这表明它最近确实已被列入黑名单。

现在我该怎么做才能使 IE8/7 触发标准模式?
有什么办法可以将该网站从黑名单中删除吗?
我想我可以使用 UA 元,如果没有其他可用的,但更愿意避免添加(又一个)不必要的 html 元素,这些元素只是为了使 IE 工作而定制的。

有关 IE8 和兼容性黑名单的更多信息

I was doing some tests on IE 8 on a standards-compliant page, with a strict doctype:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

However, apparently the page was being rendered in "IE 8 compat view"/"IE7 standards", which was breaking the layout.
After looking around, I discovered that apparently IE has a websites blacklist, forcing compatibility mode for those listed.
I then checked on this blacklisted domains DB if the site I was working on was on the list, but it isn't. It's a large site and the database definitions seem to be outdated tho, so it could be that it was added in the last year or so.

Testing the exact same page on another domain triggers IE8's standards mode, which would suggest it has been indeed blacklisted recently.

What can I do now to make IE8/7 trigger standards mode?
Is there any way to remove the website from the blacklist?
I suppose that I could use a UA meta, if nothing else is available, but would prefer to avoid adding (yet another) unnecessary html element tailored just to make IE work.

More information about IE8 and the compatibility blacklist

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

各自安好 2024-09-14 03:03:02

您可以使用放置在 HEAD 标签内的以下 META 标签强制 IE8 以标准模式渲染。我不确定这是否会覆盖本地站点上的行为,但值得一试。

<meta http-equiv="x-ua-compatible" content="IE=8">

编辑:抱歉,我没有看到你提到 UA 元 - 我想这个答案有点多余。

编辑2:DOCTYPE 声明之前是否有空格?我不久前遇到过这个问题,这只是删除在输出 DOCTYPE 之前转储的空白的问题。这使 IE8 回到标准模式。

Edit3:另外,检查您在此站点上的域/IP,它会检查多个 URIBL http://www.myiptest.com/staticpages/index.php/check-blacklisted-domain-URIBL

You can force IE8 to render in standards mode by using the follow META tag, placed inside your HEAD tags. I'm unsure if this overrides behaviour on local sites, but it is worth a try.

<meta http-equiv="x-ua-compatible" content="IE=8">

Edit: sorry, I didn't see you mention UA metas - this answer is a bit redundant I guess.

Edit 2: are there any whitespaces before the declaration of the DOCTYPE? I had this a while ago, and it was simply a matter of removing whitespace that was being dumped out before the DOCTYPE had been output. This knocked IE8 back into standards mode.

Edit3: also, check your domain/ip on this site, it checks multiple URIBLs http://www.myiptest.com/staticpages/index.php/check-blacklisted-domain-URIBL

腹黑女流氓 2024-09-14 03:03:02

scunliffe 的评论让我找到了问题所在的正确轨道:IE8 似乎以不同的方式处理 Intranet 服务器,并以兼容模式显示它们。

这是 scunliffe 的原始评论(如果你把它写为答案,我会选择你的):

你在外部域上测试这个吗?或者本地主机?或者内网服务器? - IE 默认以“不太标准”模式呈现“内部”服务器。请注意,除了 MSFT 维护的全局兼容列表之外,每个用户的 IE8 还可以在本地列表中添加/删除站点。

scunliffe's comment got me on the right track to what seems to be the problem here: IE8 seems to treat intranet servers in a different way, and shows them in compatibility mode.

Here is scunliffe's original comment (if you write it as an answer, I'll pick yours):

Are you testing this on an external domain? or a localhost? or Intranet server? - IE renders "internal" servers in its "not quite so standards" mode by default. Note that in addition to the global compat list that MSFT maintains, each user's IE8 can add/remove sites from the local list.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文