如题: 我有index.html和Default.aspx页面
http://localhost/index.html
http://localhost/Default.aspx通过以上地址都能访问,
实现在index.html里读取Default.aspx返回的HTML代码 JS如何实现?

解决方案 »

  1.   

    try:
    <html><head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>index</title>
    <script>
    function getHTML(){
    alert(document.getElementById("f1").contentWindow.document.getElementsByTagName("HTML")[0].outerHTML)
    }
    </script>
    </head><body>
    <iframe height=0 width=0 id=f1 name=f1 src="Default.aspx" onload="getHTML()"></iframe>
    </body></html>