以下代码在IE和FF上均可以通过。
<html>
<head>
<title> New Document </title>
<script language="JavaScript">
<!--
function test()
{
alert(document.documentElement.innerHTML)
}//-->
</script>
</head>
<body onload="test()">
</body>
</html>

解决方案 »

  1.   

    <HTML>
    <HEAD>
    <TITLE> New Document </TITLE>
    <SCRIPT LANGUAGE="JavaScript">
    <!--
    function getHTML(){
    alert("<"+document.documentElement.tagName+">"+document.documentElement.innerHTML+"</"+document.documentElement.tagName+">");
    }
    //-->
    </SCRIPT>
    </HEAD><BODY onload="getHTML()">
    发发发
    </BODY>
    </HTML>