简体   繁体   English

Internet explorer 8怪癖模式远程vs本地

[英]internet explorer 8 quirks mode remote vs local

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. 嗨我有一个问题,我无法理解Internet Explorer 8.我有一个包含尾随逗号的javascript代码,我知道它必须被删除,但我想了解它的一些事情。 So, here's a part of the reason of the problem, I'm in Quirks mode 所以,这是问题原因的一部分,我处于Quirks模式

<!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? 在本地或远程访问页面时,处理Quirks模式是否有区别?

the IE using the Quirks Mode per default, when accessing fron the Intranet. 当从Intranet访问时,IE默认使用Quirks模式。 You can force it into Standardmode by using this META-Tag: 您可以使用此META-Tag强制它进入Standardmode:

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

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. IE8在其设置中深埋了一个配置标志,允许您指定使用IE7兼容性引擎呈现本地Intranet上的站点。

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. 它不太可能是真正的怪癖模式,更可能只是IE7渲染引擎中的错误和缺失功能。

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

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. 希望有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM