我做了一个简单的ASP聊天室,为什么发送了聊天内容要刷新后才能看到聊天内容?有什么办法解决?

来源:百度知道 编辑:UC知道 时间:2024/05/21 04:02:36

不刷新怎么行,加一段自动刷新的网页代码就行了。网上多得很。

因为浏览器是从服务器下载页面内容,刷新等于重新从服务器下载页面内容
具体代码:
在需要刷新页面 <head> 标签里加入<meta http-equiv="refresh" content="5"> 其中"5"是秒数可根据实际情况修改.

<html>
<head>
<title>页面自动刷新</title>
<meta http-equiv="refresh" content="5">
</head>
<body></body>
</html>