如何实现自动的刷新

来源:百度知道 编辑:UC知道 时间:2024/05/10 09:15:54
我想做到,当A机用户提交一个表单后,B机在进行刷新的操作情况下,页面即时显示,就像聊天室中用来滚动现实聊天内容的区域。

请提供参考代码或您知道的完整代码,谢谢!

网页:ASP+ACCESS,VB脚本!

显示内容页面

<script language="vbscript">
Function bytes2BSTR(vIn)
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
sub loadmsg()
Set xmlHttp=CreateObject("Microsoft.XMLHTTP")
xmlhttp.Open "post", "response.asp" , false
xmlhttp.Send()
msg.innerHtml=bytes2BSTR(xmlhttp.responseBody)
timeoutid = setTimeout("loadmsg()",1000)
end sub
</script>

<body onLoad="loadmsg()">
<div id="msg"></div>
</body>

response.asp文件内容