wordpress 为什么内网站点的兼容模式

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/22269781/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 19:29:42  来源:igfitidea点击:

why compatibility mode for intranet sites

wordpressinternet-explorerintranetie8-compatibility-mode

提问by Anne Pouch

I'm a Mac person, web designer, trying to understand "Display intranet sites in compatibility mode" option with IE 11

我是 Mac 人,网页设计师,试图了解 IE 11 的“以兼容模式显示 Intranet 站点”选项

I have client, an architecture firm, that used to host their OLD website (HTML site I didn't develop) in-house on their Windows server. When the Wordpress site I recently launched for them is hosted on a Ubuntu server in house.

我有一个客户,一家建筑公司,曾经在他们的 Windows 服务器上内部托管他们的旧网站(我没有开发的 HTML 网站)。当我最近为他们启动的 Wordpress 站点托管在内部的 Ubuntu 服务器上时。

The problem is several months after we go live one guy in the office when viewing with IE is seeing their portfolio pages display thumbnail images stacking vertically vs horizontally. When they turn Display intranet sites in compatibility mode off the thumbnails display correctly. Most people aren't using IE so its not surprising its just noticed now.

问题是在我们上线几个月后,办公室里的一个人在用 IE 浏览时看到他们的投资组合页面显示的缩略图图像垂直和水平堆叠。当他们关闭以兼容模式显示 Intranet 站点时,缩略图会正确显示。大多数人不使用 IE,所以它现在才注意到并不奇怪。

Here is an example of a portfolio page

这是投资组合页面的示例

They upgraded their workstations to Windows 8.1 and IE 11 shortly after we launched the new website.

在我们推出新网站后不久,他们将工作站升级到 Windows 8.1 和 IE 11。

I am a Mac person but I have not been able to recreate the problem with that IE/Win configuration with BrowserStack, nor have any of the people I know who have that version of IE/Win been able to recreate it.

我是 Mac 用户,但我无法使用 BrowserStack 重新创建该 IE/Win 配置的问题,我认识的任何拥有该版本 IE/Win 的人也无法重新创建它。

If I recreate the portfolio page on my test site hosted by Bluehost - the clients see the portfolio pages correctly in compatibility mode.

如果我在 Bluehost 托管的测试站点上重新创建投资组合页面 - 客户可以在兼容模式下正确看到投资组合页面。

So my question is what exactly is an intranet site in this environment? This website is not an inhouse only website its public - does intranet site refer to anything else besides a website like this one? I am sure there is information in house they can see via intranet only that's not public but is that why the setting is turned on? And why would it have to be displayed in compatibility mode?

所以我的问题是在这种环境中究竟什么是 Intranet 站点?这个网站不是一个内部唯一的公共网站 - 除了像这样的网站之外,内网网站是否还指其他任何网站?我确信他们可以通过 Intranet 看到内部信息,但这些信息不是公开的,但这就是设置被打开的原因吗?为什么它必须以兼容模式显示?

Why would they need to have this compatibility turned on at all?

为什么他们需要打开这种兼容性?

回答by Ahmed Abbas

IE makes assumption about displaying intranet sites (http://someInternalSite/vs. http://someInternalSite.myCompany.org). That assumption is that intranet sites work best in compatibility mode.

IE 假设显示 Intranet 站点(http://someInternalSite/http://someInternalSite.myCompany.org)。该假设是 Intranet 站点在兼容模式下工作最佳。

It makes the so called "smart" judgement by looking at it this way: Since the website is hosted in internal servers - there must be some corporate legacy applications developed on older versions of IE. And since IE is not perfect at maintaining proper fallbacks to older versions - thus its good to turn on the compatibility mode for the rescue.

它通过这样看待它做出了所谓的“智能”判断:由于网站托管在内部服务器中 - 必须有一些在旧版本 IE 上开发的企业遗留应用程序。而且由于 IE 在保持对旧版本的适当回退方面并不完美 - 因此打开兼容模式进行救援是很好的。

To fix it either access the site with FQDN or uncheck a checkbox in “Compatibility View Settings”

要修复它,请使用 FQDN 访问站点或取消选中“兼容性视图设置”中的复选框

More info of the IE "Smart Defaults" on this blog post: http://blogs.msdn.com/b/ie/archive/2009/06/17/compatibility-view-and-smart-defaults.aspx

此博客文章中有关 IE“智能默认值”的更多信息:http: //blogs.msdn.com/b/ie/archive/2009/06/17/compatibility-view-and-smart-defaults.aspx

回答by David

I have upvoted the other answer, so i'm not really fishing for your vote. I just wanted to add the findings that i had this evening.

我已经对另一个答案投了赞成票,所以我并不是真的在为您投票。我只是想补充一下我今晚的发现。

I have a state of the art HTML5 website, that works well in every browser. However, in my own local environment IE is messing thigns up like you said, and even worse. I was thinking it was a server issue as the html that was passed as a responsetext from my server was the right HTML. however, IE was parsing it to something different ( I usually think of IE as a great browser, but I really lost it)

我有一个最先进的 HTML5 网站,它在每个浏览器中都运行良好。然而,在我自己的本地环境中,IE 就像你说的那样搞砸了,甚至更糟。我认为这是服务器问题,因为从我的服务器作为响应文本传递的 html 是正确的 HTML。然而,IE 将它解析为不同的东西(我通常认为 IE 是一个很棒的浏览器,但我真的失去了它)

this structure:

这种结构:

<header>    
    <div>
        <div></div>    
    </div>
</header>

became this in the DOM:

在 DOM 中变成了这个:

<header></header>
<div>
    <div></div>
</div>
<header><//header>

As you can see the whole DOM was parsed into something completely different and was not working, thanks to compatibility being enabled for the intranet. I did set the doctype, and validated my site on w3c, so that wasn't the problem either. The bottomline is, compatibility mode is something you want to stay away from as a developer.

正如您所看到的,整个 DOM 被解析为完全不同的东西并且无法正常工作,这要归功于对内联网启用了兼容性。我确实设置了文档类型,并在 w3c 上验证了我的网站,所以这也不是问题。底线是,兼容模式是您作为开发人员想要远离的东西。