<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 xmlhttp=new ActiveXObject("Msxml2.xmlhttp")
xmlhttp.open("GET",window.location.href,false)
xmlhttp.send()
var str = bytes2BSTR(xmlhttp.ResponseBody)
alert(str)
</script>
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 xmlhttp=new ActiveXObject("Msxml2.xmlhttp")
xmlhttp.open("GET",window.location.href,false)
xmlhttp.send()
var str = bytes2BSTR(xmlhttp.ResponseBody)
alert(str)
</script>
str="";
function sethtml()
{
str=document.documentElement.outerHTML;
alert(str);
}
</script>
<body>
ballack
<p>kahn
<p><input onclick=sethtml()>
function view() {
viewwin=window.open("","code","")
var code=document.body.innerHTML
viewwin.document.body.innerText=code
}
// --></script>
而下面两位的只能获取本域的页面,但是速度可能较快。