IE - 本地和远程部署的系统之间的行为差​​异 [英] IE - differences in behaviour between system deployed locally and remotely

查看:189
本文介绍了IE - 本地和远程部署的系统之间的行为差​​异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在IE中遇到了有线问题。当我浏览我的asp.net mvc应用程序,这是部署在本地,一切都按预期工作。



在这两种情况下,我使用相同的IE实例,安装



假设我在css文件中定义了类:

 <$> c $ c> .field-required:before 
{
color:red;
content:*;
font-weight:bold;
}



我还有一个简单的标签,它使用这个类:

 < label class =field-requiredfor =UserName>用户名< / label> 

当系统部署在本地时,此类代码呈现为:







为什么不显示红星在第二种情况下?虽然我使用firefox一切正常工作。在IE中访问远程页面时,是否启用了任何安全策略或某些功能,这会禁用某些功能?昨天我有一个问题,JSON,这是无法识别,而我正在浏览我的远程部署的系统。当本地部署相同的系统时,一切工作。但是,我仍然使用IE的相同实例。由于这是同一个浏览器,会发生什么情况?



UPDATE



这是整个来源

 <!DOCTYPE html& 
< html>
< head>
< style>
.field-required:before
{
color:red;
内容:*;
font-weight:bold;
}
< / style>
< / head>

< body>
< div>< label class =field-requiredfor =UserName>用户名< / label>< / div>
< div>< input id =UserNamename =UserNametype =textvalue =/>< / div>
< / body>
< / html>

缓存不是问题

解决方案

content 属性在IE8中工作,但在IE7中不起作用。



因此,我确信您的页面在本地以IE8模式呈现,在您的其他服务器上,它正在IE7兼容模式下呈现。



您可以从两个位置打开页面,按F12,然后查看文档模式请验证此。



有各种原因可能会发生。



请参阅: http://hsivonen.iki.fi/doctype/#ie8modes



最可能的原因是您在IE中按下了IE7兼容模式按钮。



您可以通过添加此元标记快速修复 :

 < meta http-equiv =X-UA-Compatiblecontent =IE = edge/& 

如果没有,请查看链接中的列表,了解原因是什么。


I have wired issues in IE. While I'm browsing my asp.net mvc application which is deployed locally, everything is working as expected. Some annoying differences appears, while I'm browsing my system when it is deployed on different host.

In both cases, I'm using the same instance of IE, installed locally on my primary computer.

Suppose I have defined class in css file:

.field-required:before
{
    color: red;
    content: "*";
    font-weight: bold;
}

I have also simple label, which uses this class:

<label class="field-required" for="UserName"> Username </label>

When the system is deployed locally, such code renders this way:

http://localhost/system/page

The same code deployed on remote server (named host2), accessed from second tab of my IE browser installed locally on my primary computer, renders as follows:

http://host2/system/page

Why is the red star not shown in the second case? While I'm using firefox everything works as expected. Is there turned on any security policy or something while accessing remote pages in IE, which disables some functionality? Yesterday I had a problem with JSON, which was not recognized, while I was browsing my system deployed remotely. Everything worked when the same system was deployed locally. But still, I'm using the same instance of IE. Since this is the same browser, what is going on?

UPDATE

This is the entire source

<!DOCTYPE html>
<html>
<head>    
    <style>
        .field-required:before
        {
            color: red;
            content: "*";
            font-weight: bold;
        }
    </style>
</head>

<body>
    <div><label class="field-required" for="UserName">Username</label></div>
    <div><input id="UserName" name="UserName" type="text" value="" /></div>
</body>
</html>

Caching is not the problem

解决方案

The content property works in IE8, but does not work in IE7.

Therefore, I'm sure that your page is being rendered in IE8 mode locally, but on your other server it is being rendered in IE7 Compatability Mode.

You can open the page from both locations, press F12, and look at the "Document Mode" setting to verify this.

There are various reasons this could be happening.

See: http://hsivonen.iki.fi/doctype/#ie8modes

The most likely cause is that you pressed the "IE7 compatibility mode" button in IE.

You can possibly "quick fix" the issue by adding this meta tag:

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

If not, look down that list in the link and see which reason is the cause.

这篇关于IE - 本地和远程部署的系统之间的行为差​​异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆