IE有一个浏览器模式和文档模式,我似乎只能通过添加这个来编程设置文档模式:
<meta http-equiv="X-UA-Compatible" content="IE=5" />
这为我正确设置了文档模式,但我需要将浏览器模式更改为兼容性视图。我的网站只能以这种方式使用这两种设置。我尝试过更改DocType和其他元设置,但似乎没有任何效果。我还确认了我在工具 - &gt;兼容性设置下的IE设置,未选中所有3个复选框,列表框中没有任何内容。
我的网站是在IIS6(Windows 2003 Server)上运行的ASP.NET 2.0。
这是一个演示此内容的简单示例网站。在IE10中打开它,然后查看开发人员工具(F12):
<html>
<head>
<title>This is the title</title>
<meta http-equiv="X-UA-Compatible" content="IE=5" />
<script type="text/jscript" language="jscript">
function foo() {
alert("document.documentMode: " + document.documentMode +
"\n\rdocument.compatMode: " + document.compatMode +
"\n\rnavigator.userAgent: " + navigator.userAgent);
}
</script>
</head>
<body onload="javascript:foo();">
This is a test site
</body>
</html>
答案 0 :(得分:0)
首先,必要的chiding:如果这是你的网站,你应该修复它以符合现代标准。
也就是说,您可能以这样的方式访问此站点,即它已加载到Intranet区域中,并且您说您已在兼容性视图设置中禁用了在兼容性视图中显示Intranet站点的选项。 (我相信它默认启用。)
Intranet区域设置override your page's settings,因此您必须重新启用该选项。