Forum Moderators: open
Try this in anything but IE Win:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Untitled</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
</head>
<body>
<script type="text/javascript">
var dt=document.doctype;
alert(dt.name+"\n"+dt.publicId+"\n"+dt.systemId);
</script>
</body>
</html>
Okay then, is there any way to just read the source of the currently loaded document without having to requery the server? I've tried reading document.documentElement.outerHTML and that gets everything but the!DOCTYPE.
<script type="text/javascript">
strict=false
var d=document.doctype
strict=(document.compatMode=="CSS1Compat")
strict=(d&&d.systemId?(d.systemId.indexOf("strict")>-1?true:(d.publicId.indexOf("transitional")>-1?true:false)):(d&&d.publicId.indexOf("transitional")==-1?true:strict))
strict=(d&&d.name.indexOf(".dtd")>-1)?true:strict
alert("strict= "+strict)
</script>