如何在不单击按钮的情况下强制 IE8 进入兼容模式

发布于 2024-11-07 07:44:52 字数 327 浏览 1 评论 0原文

最近,我被要求协助我的城市建设他们的网站。当我去那里时,我发现他们一直在使用 Web Expressions。当他们在程序中预览页面时,它看起来很好,但当您在任何其他浏览器中打开它时,布局都相互重叠,一切都混乱了。

他们不想重新启动任何东西,所以我唯一想做的就是强制 IE 8 将其渲染为 IE 7。

我已经研究了一段时间了,我知道 一行代码,我已经尝试过了,它甚至可以工作,但是,他们不喜欢让用户必须使用按钮的想法。有没有办法让IE8直接进入兼容模式而不需要用户点击兼容按钮?

我也知道 documentMode,可以在 javascript 中将其设置为 = 7 吗?这会改变什么吗?

I was recently asked to assist my city with their website. What i found when i went there, was they had been using Web Expressions. When they previewed the page within the program, it looked fine, when you open it in any other browser though, the layout it all over riding each other and everything is all jumbled.

They don't want to re start anything so the only thing that i am trying to do is force the IE 8 to render it as IE 7.

I've been researching for awhile now and i know about the

line of code and i've tried this, it works even, however, they don't like the idea of having their users have to use a button. Is there a way to have the IE8 go straight into compatibility mode without having the users click the compatibility button?

I also know about the documentMode, can that be set to = 7 in javascript? Would that change anything?

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

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

发布评论

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

评论(1

季末如歌 2024-11-14 07:44:52

如果您还没有这样做,请尝试将其放入 HTML 标头中:

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

更多信息:http://msdn.microsoft.com/en-us/library/cc288325(v=vs.85).aspx

If you've not already done so, try putting this in the header of your HTML:

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

More information: http://msdn.microsoft.com/en-us/library/cc288325(v=vs.85).aspx

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