如何解决文档模式在重启IE 9 [英] How to fix Document mode restart in IE 9

查看:652
本文介绍了如何解决文档模式在重启IE 9的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有在IE9中打开我的网站的一个问题。当我尝试打开我的地盘我在开发工具得到这个错误:

I have a problem with opening my website in IE9. When I try to open my site I get this error in dev tools:

HTML1113: Document mode restart from Quirks to IE9 Standards

我用Google搜索,发现建议使用一个答案:

I googled and found an answer that suggested to use this:

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

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

...但这些不工作,我得到以下信息这一次:

...but these do not work and I get the following message this time:

HTML1115: X-UA-Compatible META tag ('IE=Edge') ignored because document mode is already finalized.

什么是我的问题吗?我喜欢读<一个几篇文章href=\"http://blogs.msdn.com/b/ie/archive/2010/06/16/ie-s-compatibility-features-for-site-developers.aspx?Redirected=true\">IE’s兼容性功能站点开发通过微软和跟踪我的网站Determining IE9的文档模式流程图和使用有关的!DOCTYPE 在这些网站上的所有建议,但网页打开后没有人能解决我的问题,我的IE引擎复位。

What is my problem? I read several articles like IE’s Compatibility Features for Site Developers by Microsoft and traced my site with Determining IE9’s Document Mode flowchart and use all suggestions relating to !doctype on these sites but no-one could solve my problem and my IE engine reset after the page opened.

我开发我的ASP.NET 4在Windows Server 2008上的站点。
我怎样才能解决这个问题?

I develop my site with ASP.NET 4 on Windows Server 2008. How can I fix this issue?

推荐答案

一个解决方法,应始终工作是把你的 X-UA兼容在HTTP头。另外,你的&LT;!DOCTYPE&GT; 应在HTML文档的顶部指定(&LT;!DOCTYPE HTML&GT; 是最简单的一个)。

One solution that should always work is to put your X-UA-Compatible in HTTP headers. Also, your <!DOCTYPE> should be specified at the top of your HTML document (<!DOCTYPE html> is the easiest one).

如果你把你的 X-UA兼容声明中的标签,你会遇到以下问题

If you put your X-UA-Compatible declaration inside the meta tag you can run into the following problems:


  1. <$c$c>X-UA-Compatible除非它是你网页的第一个4K内present被忽略。的如果你把它放在你的部分(或底部)将其移动到顶部。它最好的地方是后立即编码和语言的声明。

  2. X-UA兼容,如果它把里面的IE条件注释被忽略。例如:

  1. X-UA-Compatible is ignored unless it's present inside the first 4k of you page. If you put it somewhere in the bottom of your head section (or in the body) move it to top. The best place for it is right after encoding and language declarations.
  2. X-UA-Compatible is ignored if it's put inside IE conditional comments. For example:

<!--[if IE]>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<![endif]-->

在这种情况下,你应该删除条件注释。

In this case you should remove conditional comments.

此外,你不应该在 DOCTYPE 声明之前的任何文本。 如果你有任何HTML注释在那里,例如,IE就会自动切换到怪癖模式。

Also, you shouldn't have any text before the doctype declaration. If you've got any HTML comments there, for example, the IE will switch to quirks mode.

最后,请检查您是否正在查看从Intranet这个网站。默认情况下兼容性视图为Intranet站点启用。

Finally, check if you're viewing this site from the intranet. By default Compatibility View is enabled for Intranet sites.

我建议设置 X-UA兼容头为你的页面,然后看看你的网站仍然是切换到怪癖模式。在这种情况下,你应该检查你的标记,并尝试修复任何 HTML验证错误,直到它的回标准模式。

I suggest set X-UA-Compatible header for you page and then see if your site is still switching to quirks mode. In that case you should check your markup and try to fix any HTML validator errors until it's back to Standards Mode.

这篇关于如何解决文档模式在重启IE 9的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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