1,xnlhttp.open("GET",url.false)
2,window.document.documentElement.outerHTML(知道窗口名称的条件下)

解决方案 »

  1.   

    TO net_lover(孟子E章) :可否详细说说方法1?最好能给一段sample code。
    :)
      

  2.   

    <script>
    var oDiv //添加用的节点
    var nP //DIV的 padding-left
    var xh //xmlhttp
    function getXML()
    {
    oDiv = document.all.m
    oDiv.innerHTML = "正在装载栏目数据,请稍侯......."
    oDiv.style.display= ""
    xh = new ActiveXObject("Microsoft.XMLHTTP")
    xh.onreadystatechange = getReady
    xh.open("GET",a.value,true)
    xh.send()
    }function getReady()
    {
    if(xh.readyState==4)
    {
    if(xh.status==200)
    { oDiv.innerHTML = "完成"
    }
    else
    {
    oDiv.innerHTML = "抱歉,装载数据失败。原因:" + xh.statusText
    }
    }
    }
    </script>
    URL:<input name=a value="http://www.microsoft.com">
    <input onclick="getXML()" type="button" value="get HTML">
    <input onclick="if(xh && xh.responseText) oDiv.innerHTML=xh.responseText" type="button" value="output">
    <div id=m></div>
      

  3.   

    TO net_lover(孟子E章) :我获取的中文全是乱码,可否告知怎么解决?
      

  4.   

    <script language="vbscript">
    Function bytes2BSTR(vIn) Dim strReturn,i,ThisCharCode,innerCode,Hight8,Low8,NextCharCode
    strReturn = "" For i = 1 To LenB(vIn)
    ThisCharCode = AscB(MidB(vIn,i,1))
    If ThisCharCode < &H80 Then
    strReturn = strReturn & Chr(ThisCharCode)
    Else
    NextCharCode = AscB(MidB(vIn,i+1,1))
    strReturn = strReturn & Chr(CLng(ThisCharCode) * &H100 + CInt(NextCharCode))
    i = i + 1
    End If
    Next bytes2BSTR = strReturnEnd Function
    </script><script language=javascript>
    var oDiv //添加用的节点
    var nP //DIV的 padding-left
    var xh //xmlhttp
    function getXML()
    {
    oDiv = document.all.m
    oDiv.innerHTML = "正在装载栏目数据,请稍侯......."
    oDiv.style.display= ""
    xh = new ActiveXObject("Microsoft.XMLHTTP")
    xh.onreadystatechange = getReady
    xh.open("GET",a.value,true)
    xh.send()
    }function getReady()
    {
    if(xh.readyState==4)
    {
    if(xh.status==200)
    { oDiv.innerHTML = "完成"
    }
    else
    {
    oDiv.innerHTML = "抱歉,装载数据失败。原因:" + xh.statusText
    }
    }
    }
    </script>
    URL:<input name=a value="http://www.microsoft.com">
    <input onclick="javascript:getXML()" type="button" value="get HTML">
    <input onclick="javascript:if(xh && xh.responseText) oDiv.innerHTML=bytes2BSTR(xh.ResponseBody)" type="button" value="output">
    <div id=m></div>
      

  5.   

    如何把这些数据post出去呢?(页面上不要任何显示)