Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/37.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/40.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net 如何在不访问代码的情况下将doctype更改为标准模式?_Asp.net_Css_Internet Explorer_Doctype_Quirks Mode - Fatal编程技术网

Asp.net 如何在不访问代码的情况下将doctype更改为标准模式?

Asp.net 如何在不访问代码的情况下将doctype更改为标准模式?,asp.net,css,internet-explorer,doctype,quirks-mode,Asp.net,Css,Internet Explorer,Doctype,Quirks Mode,我正在设计一个基于网站的.NET软件CMS解决方案,它不遵循当前的最佳实践。它使用表和doctype。软件公司不允许您编辑.aspx文件或js。它们只允许您编辑样式表和不同的模块,例如HTML模块、天气模块、幻灯片模块等 因此,IE总是以怪癖模式呈现网站,打破CSS。我无权更改doctype或编辑中的任何内容 有没有办法在无法访问代码的情况下更改doctype 我要处理的是: <!--DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transition

我正在设计一个基于网站的.NET软件CMS解决方案,它不遵循当前的最佳实践。它使用表和doctype
。软件公司不允许您编辑
.aspx
文件或
js
。它们只允许您编辑样式表和不同的模块,例如HTML模块、天气模块、幻灯片模块等

因此,IE总是以怪癖模式呈现网站,打破CSS。我无权更改doctype或编辑
中的任何内容

有没有办法在无法访问代码的情况下更改doctype

我要处理的是:

<!--DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" -->
<html>
<head id="htmlHead"><title>
Welcome to xxx
</title>

<script type="text/javascript" language="JavaScript">
        function stopError()
        {
          return true;
        }
        window.onerror = stopError;
</script>

<link href="xxx.css" rel="stylesheet" type="text/css" />
<meta name="ROBOTS" content="INDEX,NOFOLLOW" />
<link href="xxx/favicon.ico" rel="SHORTCUT ICON" />
<style id="spMenuStyle"></style>
<link id="ApplicationRoot" rel="AppRoot" href="/xxx/" /><script type="text/javascript" src="/xxx/scripts/Utility.js">
</script>
<script type="text/javascript" language="javascript" sr="cxxx/BlockIFrame.js">
</script>
<link href="/xxx/WebResource.axd?d=9IeP9KvvsN3Ik1tvDsOJspkYjKE_KnZBT8bvXX7faYYRqxbjgHhLZKgtKfFSoL4-itgpmZrgTG68lyrA-SRm95xnEdLdUHa4j1nbnB_xoc_0zNWbtGMRDJOai6Kgu4UI0Dg5lw2&amp;t=634950712700000000" type="text/css" rel="stylesheet" class="Telerik_stylesheet" />
</head>

欢迎来到xxx
函数stopError()
{
返回true;
}
window.onerror=停止错误;

如果您能够注入自己的JavaScript,那么您可能能够注入
X-UA-Compatible
元标记

此代码将注入元标记并强制IE在边缘模式下运行,这意味着IE将其视为标准模式:

var meta = document.createElement('meta');
meta.setAttribute('http-equiv', 'x-ua-compatible');
meta.setAttribute('content', 'IE=edge');

document.getElementsByTagName('head')[0].appendChild(meta);

代码第一行中的构造根本不是doctype;这只是一个评论。没错!我不能取消注释。问题是“软件公司不允许您编辑.aspx文件或js”,但也许可以插入
脚本
元素。然而,在HTML代码中插入这样的元素时,可能会被CMS剥离。D'oh我完全没有意识到JS不能修改。如果没有任何代码更改,这可能是不可能的。这是最好的尝试。无论如何,谢谢你。