当我使用服务器名称时IE忽略条件注释 [英] IE ignoring conditional comment when I use server name
问题描述
我的网页中包含以下代码:
I have a web page with the following code in it:
<!--[if IE 8]>
Welcome to IE 8
<![endif]-->
我登录到服务器,如果我通过URL <$在IE 8中点击页面c $ c> http:// localhost / login 我看到了这条消息。但是,如果我使用URL http:// myserver / login
(其中 myserver
是服务器的Windows名称我登录),页面显示和正常运行,但不显示消息。
I am logged onto the server, and if I hit the page in IE 8 via the URL http://localhost/login
I see the message. However, if I use the URL http://myserver/login
(where myserver
is the Windows name of the server I am logged into), the page displays and functions normally, except that the message is not displayed.
如果我查看了源代码,我会看到代码正如我所期望的那样 - 注释显示在源代码中。 (好吧,我真的想加载一个条件样式表,当我使用服务器名时它没有被加载,但是这个简单的例子显示了相同的结果)。
If I do a View Source, I see the code as I expect it -- the comment displays in the source. (OK, I'm really trying to load a conditional style sheet and it is not being loaded when I use the server name, but this simple example shows the same result).
有关如何退出这个新的IE之旅的想法吗?
Any ideas how to exit this new trip to IE bizarro-land?
推荐答案
在页面设置中,你有'显示兼容性视图中的Intranet站点'已选中?全部是在此解释博客文章。
In Page Settings, do you have 'Display intranet sites in Compatibility View' checked? It's all explained in this blog post.
这篇关于当我使用服务器名称时IE忽略条件注释的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!