xmlhttp.Open "POST","aaa.asp",false 其中 aaa.asp不返回xml数据,返回普通html网页可不可以?
xmlhttp.Open "POST","aaa.asp",false 其中 aaa.asp不返回xml数据,返回普通html网页可不可以? 问题点数:50、回复次数:3Top
1 楼net_lover(【孟子E章】)回复于 2002-09-20 21:15:36 得分 0
可以的
Top
2 楼net_lover(【孟子E章】)回复于 2002-09-20 21:18:11 得分 50
<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 = strReturn
End Function
</script>
<script language="javascript">
var xmlhttp= new ActiveXObject("Msxml2.xmlhttp")
xmlhttp.open("GET","http://www.csdn.net/",false)
xmlhttp.send()
alert(bytes2BSTR(xmlhttp.ResponseBody))
</script>
ASP版本的:
<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 = strReturn
End Function
Dim xmlhttp
set xmlhttp=Server.CreateObject("Msxml2.xmlhttp")
xmlhttp.open "GET","http://www.csdn.net/",false
xmlhttp.send
response.write bytes2BSTR(xmlhttp.ResponseBody)
</script>Top
3 楼feipig(飞猪)回复于 2002-09-20 21:44:48 得分 0
错误我试了asp版的,网页无法显示Top




