我如何以编程方式禁用IE兼容模式? [英] How can I programmatically disable IE compatibility mode?

查看:110
本文介绍了我如何以编程方式禁用IE兼容模式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直坚持这一段 - 我无法弄清楚为什么一个网站在两个相同版本的Internet Explorer中呈现不同的效果。半小时前,我遇到IE中的兼容模式按钮,这让我非常生气。



禁用兼容模式已解决了我的问题。

有没有办法以编程方式禁用它,即从网页?

编辑: 刚刚碰到这个博客 https:/ /blogs.msdn.com/b/askie/archive/2009/03/23/understanding-compatibility-modes-in-internet-explorer-8.aspx



在阅读文章后,我会发布一个示例代码。如果您想要旧渲染,并且不需要按钮显示在工具栏上,以便用户可以切换使用此模式的模式:

 < head> 
<! - 模拟Internet Explorer 7 - >
< meta http-equiv =X-UA-Compatiblecontent =IE = EmulateIE7>
< title>我的网页< / title>
< / head>

其他选项(新旧)包括: IE = 5 IE = 7 IE = 8 IE =边



(边缘等于可用的最高模式)

I have been stuck on this one for a while - I couldn't figure out why a website renders differently in two identical versions of Internet Explorer. Half an hour ago I came across a compatibility mode button in IE which made me really angry.

Disabling compatibility mode has fixed my problem.

Is there a way to disable it programmatically, i.e. from a web page?

Edit:

Just came across this blog https://blogs.msdn.com/b/askie/archive/2009/03/23/understanding-compatibility-modes-in-internet-explorer-8.aspx

I'll post an example code after reading the article

解决方案

If you want the "old" rendering, and no button to show up on the toolbar so that users can switch modes you can use this:

<head>
  <!-- Mimic Internet Explorer 7 -->
  <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" >
  <title>My Web Page</title>
</head>

other options (old and new) include:IE=5, IE=7, IE=8, or IE=edge

(edge equals highest mode available)

这篇关于我如何以编程方式禁用IE兼容模式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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