经典 ASP 页面自动将 IE 8 中的 Quriks 模式设置为默认模式

发布于 2024-08-20 10:45:29 字数 107 浏览 4 评论 0原文

查看 HTML 时,IE 8 将默认文档模式设置为 IE8 标准,但它会在 ASP 页面上进入怪异模式。
即使我使用 这并没有真正的帮助。
我应该怎么办?

While viewing the HTML IE 8 sets the default document mode as IE8 Standards as it should but it enters quirks mode on an asp page.
Even if I use <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
it doesn't really help.
What should I do?

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

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

发布评论

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

评论(3

画离情绘悲伤 2024-08-27 10:45:29

我要做的第一件事是将相同的输出放入 HTM 文件中并访问它。如果你得到不同的结果,那么确实发生了一些奇怪的事情,因为我怀疑 IE8 是否有任何方法以不同的方式对待“asp”。

顺便说一句,你怎么知道它实际上进入了怪癖模式?

如果您像这样使用更强的 DTD,会发生什么:-

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

它仍然保持在怪异模式吗?

您不会混淆 IE7 兼容性与 Quirksmode 吧?

IE7 在如何呈现标准模式 HTML 方面也存在许多错误,也许我们看到的是 IE7 兼容性。

使用 fiddler 检查随内容一起发送的标头。有没有这样的标题:-

X-UA 兼容:IE=EmulateIE7

响应中的 IE=EmulateIE7?

浏览器 UI 中的地址旁边是否存在“兼容性”按钮?

First thing I would do would be place identical output in a HTM file and visit that instead. If you get different results then there really is something wierd going on because I doubt IE8 has any way to treat "asp" any differently.

BTW, How do you know its actually going into quirksmode?

What happens if you use stronger DTD like this:-

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

Does it still remain in quirksmode?

You're not confusing IE7 compatibility with Quirksmode are you?

IE7 had a number of bugs in how it render even Standards mode HTML, perhaps what are seeing is IE7 compatibility instead.

Use fiddler to examine the headers being sent with the content. Is there a header like this:-

X-UA-Compatible: IE=EmulateIE7

in the response?

Is the Compatibility button present next to address in the brower UI?

花桑 2024-08-27 10:45:29

唯一真正有效的是 ,其他浏览器会忽略它,但 IE 将被迫除非您做了一些非常愚蠢的事情,例如在 HTML 之前添加某些内容,否则请处于 IE-8 模式。

The only thing that actually works is <meta http-equiv="X-UA-Compatible" content="IE=8"/>, other browsers will ignore it but IE will be forced to be in IE-8 mode unless you've done something really stupid like putting something before the HTML.

地狱即天堂 2024-08-27 10:45:29

我一直在编写基于标准的经典 ASP。要检查的内容是您的 HTTP 标头。确保没有将某些内容插入到您的 HTTP 标头中以导致其使用怪异模式。可能会检查您的 IIS 框,以确保 IIS 中的“自定义 HTTP 标头”部分中没有发送任何内容。另外,请检查您的文档类型是否确实正确。最后,确保您没有任何可以更改渲染模式的 IE 特殊元标记。仅仅因为经典 ASP 很旧并不意味着浏览器显示的它与任何其他 HTML 页面有任何不同。老实说,浏览器根本不关心扩展名是什么。如果它被用作 html mime 类型,那么它将如此呈现。

I write standards based classic ASP all the time. The things to check would be your HTTP headers. Make sure something isn't being inserted into your HTTP header to cause it to use quirks mode. Might check your IIS box to make sure there isn't something being sent in the "Custom HTTP Headers" section in IIS. Also, check that your doctype is indeed correct. Lastly, make sure that you do not have any of IE's special meta tags that can change the rendering mode. Just because classic ASP is old doesn't mean that the browser would display it any different than any other HTML page. Honestly the browser doesn't really even care what the extension is. If it is served as html mime type then it will render as such.

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