如何在IE兼容模式下打开本地HTML文档?
我创建了一个快速而肮脏的 HTML 文件来演示我在 IE 兼容模式下遇到的问题。当我从桌面上用 IE8 打开它时,它以标准模式打开。我需要能够将其切换到兼容模式,但是当我查看本地 HTML 文档时,该图标会消失。这是怎么回事?
更新:三个提议的解决方案都没有导致 IE8 中显示兼容模式图标。相反,我将代码放入 .aspx 页面并通过 Visual Studio 执行。由于它源自本地主机,浏览器认为它是一个远程文档,并像我想要的那样显示兼容性图标。
然而,如果任何人都可以让这个工作而不必这样做,我仍然愿意接受想法,因为启动网络应用程序对我来说并不是真正的理想解决方案。
I created a quick and dirty HTML file to demonstrate an issue I am encountering in IE compatibility mode. When I open it in IE8 from my desktop, it opens in standard mode. I need to be able to switch it to compatibility mode, but the icon for that disappears when I am viewing a local HTML document. What's up with that?
UPDATE: None of the three proposed solutions has resulted in the compatibility mode icon showing in IE8. Instead, I have put my code into an .aspx page and executed it through Visual Studio. Since it's originating from localhost, the browser thinks it is a remote document and is displaying the compatibility icon like I wanted.
However, if anyone can get this to work without having to do that, I am still open to ideas since launching a web app isn't really the ideal solution for me.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我不确定这是否有效,因为 IE 的许多 关于本地文件和兼容模式的疯狂例外和规则,但请尝试META 标记方法。
例如,在您的
中说:
请参阅 了解兼容性模式,以确保您选择正确的模式。
I'm not sure whether this'll work because of IE's many crazy exceptions and rules regarding local files and compatibility mode, but try the META tag approach.
In your
<head>
, for example say:See understanding compatibility modes to make sure you pick the right one.
您可以尝试按 F12 打开开发人员工具栏,然后在其中进行更改。
更新:您是否尝试过工具>兼容性视图设置>在兼容性视图中显示所有网站?
You could try pressing F12 to open the developer toolbar, and change it in there.
Update: Have you tried tools > compatibility view settings > display all websites in compatibility view?
http://blogs .msdn.com/b/ie/archive/2009/06/17/compatibility-view-and-smart-defaults.aspx
http://blogs.msdn.com/b/ie/archive/2009/06/17/compatibility-view-and-smart-defaults.aspx
所提出的三种解决方案均未导致 IE8 中显示兼容模式图标。相反,我将代码放入 .aspx 页面并通过 Visual Studio 执行。由于它源自本地主机,浏览器认为它是一个远程文档,并像我想要的那样显示兼容性图标。
然而,如果任何人都可以让这个工作而不必这样做,我仍然愿意接受想法,因为启动网络应用程序对我来说并不是真正的理想解决方案。
None of the three proposed solutions has resulted in the compatibility mode icon showing in IE8. Instead, I have put my code into an .aspx page and executed it through Visual Studio. Since it's originating from localhost, the browser thinks it is a remote document and is displaying the compatibility icon like I wanted.
However, if anyone can get this to work without having to do that, I am still open to ideas since launching a web app isn't really the ideal solution for me.