Internet Explorer 8 怪异模式远程与本地

发布于 2024-10-30 20:14:54 字数 376 浏览 5 评论 0原文

你好 我遇到了一个无法理解 Internet Explorer 8 的问题。我有一个包含尾随逗号的 JavaScript 代码,我知道它必须被删除,但我想了解一些有关它的信息。那么,这里是问题的部分原因,我在 Quirks 模式下

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

我的问题是,当我以本地模式打开页面时,没有问题,并且页面显示正确。但是,当我从远程服务器访问它时,页面中出现错误。 当本地或远程访问页面时,处理 Quirks 模式是否有区别?

Hi
I had a problem that i couldn't understand with internet explorer 8. I have a javascript code containing a trailing comma, i know it have to be deleted, but I want to understand something about it. So, here's a part of the reason of the problem, I'm in Quirks mode

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

My problem is, when I open the page in local mode, there is no problem, and the page is displayed correctly. However, when i access it from the remote server, there is errors in the page.
Is there a difference in treating Quirks mode when a page is accessed locally or remotely?

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

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

发布评论

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

评论(2

夜雨飘雪 2024-11-06 20:14:54

从 Intranet 访问时,IE 默认使用 Quirks 模式。
您可以使用此 META 标签强制其进入标准模式:

<meta http-equiv=\"X-UA-Compatible\" content=\"IE=8\" />

the IE using the Quirks Mode per default, when accessing fron the Intranet.
You can force it into Standardmode by using this META-Tag:

<meta http-equiv=\"X-UA-Compatible\" content=\"IE=8\" />
一曲爱恨情仇 2024-11-06 20:14:54

IE8 在其设置中深埋了一个配置标志,允许您指定使用 IE7 兼容引擎呈现本地 Intranet 上的站点。

这很有可能就是您所看到的。它不太可能是真正的怪异模式,更有可能只是 IE7 渲染引擎中的错误和缺失的功能。

要查明是否发生了这种情况,请打开“开发人员工具”窗口(按 F12)并查看工具栏 - 它会告诉您浏览器模式:如果它显示“IE7”或“兼容性视图”,那么您需要更改它到IE8,然后找到设置标志并更改它。

同一个工具栏还会告诉您是否确实处于怪异模式,因此您也可以同时确认这一点。

如果您确实需要更改浏览器设置上的兼容性视图,那么坏消息是您可能会发现自己必须在网络中的所有计算机上执行此操作(或让其他人为您执行此操作!)。幸运的是,您可以在网页上进行修复以强制浏览器模式,而无需设置标志。将以下行添加到您的站点,它应该可以解决问题:

<meta http-equiv="X-UA-Compatible" content="IE=edge" />

希望有帮助。

IE8 has a config flag buried deep in its settings that allows you to specify that sites on the local intranet are rendered using the IE7-compatibility engine.

It's a very good chance that this is what you're seeing. It's not likely to be actual quirks-mode, more likely to be just the bugs and missing features in the IE7 rendering engine.

To find out if this is what has happened, open the Developer Tools window (press F12) and look in the toolbar -- it will tell you the Browser Mode: if it says 'IE7' or 'Compatibility View' then you need to change it to IE8, and go find the settings flag and change that.

This same toolbar will also tell you whether you're actually in quirks mode or not, so you can confirm that too at the same time.

If you do need to change the compatibility view on the browser settings, then the bad news is that you may find yourself having to do that on all the machines in your network (or having someone else do it for you!). Fortunately, there is a fix which you can put on your web page to force the browser mode without having to set the flag. Add the following line to your site, and it should solve the problem:

<meta http-equiv="X-UA-Compatible" content="IE=edge" />

Hope that helps.

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