日期:2014-05-16  浏览次数:20393 次

如何确定页面中是否有"<!DOCTYPE...>"!
用这个不好用document.documentElement.outerHTML
再有一个就是不能更改.

<!DOCTYPE   html   PUBLIC   "-//W3C//DTD   XHTML   1.0   Strict//EN "   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd ">
<html>
<head>
<meta   http-equiv= "Content-Type "   content= "text/html;   charset=utf-8 ">
<title> 无标题文档 </title>
</head>

<body> ,,, </body> </html>

------解决方案--------------------
使用document.compatMode,如果值为“CSS1compat”就表明该页面被定义了头