如何使IE 9标准模式成为默认模式? [英] How to make IE 9 Standards Mode the default mode?

查看:229
本文介绍了如何使IE 9标准模式成为默认模式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网站,当兼容模式关闭时(兼容符号为灰色),在IE9中可以正常运行。启用兼容模式(蓝色)后,jQuery完全无法使用。我在网站上添加了以下标记,以告知浏览器不应使用兼容模式。

I have a web site that works perfectly fine in IE9 when compatibility mode is turned OFF (the compatibility symbol is gray). When compatibility mode is turned on (blue), the jQuery doesn't work at all. I have added the following tag to the site to tell the browser that compatibility mode should NOT be used.

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

我的文档类型为:

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

不过,浏览器似乎未默认为标准模式,用户必须手动确保不在兼容模式下。

Still, the browser doesn't seem to default to standard mode and the user must manually ensure that they are NOT in compatibility mode.

我可以禁用IE 9兼容模式吗?我是否已完成禁用IE 9兼容模式所需的操作?用户可以始终覆盖IE 9标准模式吗?

Can I disable IE 9 Compatibility Mode? Have I done what I need to do to disable IE 9 Compatibility Mode? Can the user always override IE 9 Standards Mode?

推荐答案

尝试使用此DOCTYPE声明:

Try using this DOCTYPE declaration:

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

在以下位置找到:
https://stackoverflow.com/a/6049675/796404

另一个答案是使用新的HTML5 DOCTYPE:

Another answer was to use the new HTML5 DOCTYPE:

<!DOCTYPE html>

声明如下:
http://msdn.microsoft.com/en-us/library/gg699338(v = vs.85) .aspx

我希望这会有所帮助!

这篇关于如何使IE 9标准模式成为默认模式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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