日期:2014-05-16 浏览次数:20346 次
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>test</title>
<script type="text/javascript">
window.onload = function(){
var doctype = "";
if(document.doctype){
doctype = document.doctype.systemId;
}else if(document.all && document.documentElement){
var html = document.documentElement.previousSibling;
if(html && html.nodeType == 8){
doctype = html.data;
}
}
if(doctype.indexOf("loose.dtd") >= 0){
alert("YES");
}else{
alert("NO");
}
};
</script>
</head>
<body>
</body>
</html>