怎样实现在线用户的实时刷新?(急急如律令!)

flyingghost 2001-10-12 02:02:22
怎样实现在线用户的实时刷新?是用IsClientConnected吗?怎样实现具体代码?vbscript中有没有类似vb中的timer控件的东东?
...全文
110 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
flyingghost 2001-10-15
  • 打赏
  • 举报
回复
呵呵,多谢!完美解决!
karma 2001-10-12
  • 打赏
  • 举报
回复
of course, you need to distinguish between "refresh" and "close" action, see my response to similar posts
karma 2001-10-12
  • 打赏
  • 举报
回复
inside your pages, add an onunload event handler, it will load a leave.asp page. In this page, you will update your online list and display a message. For example, something like this:

onepage.asp:
<body onunload="quit()">
<script language="javascript">
function quit()
{
window.open("leave.asp","_blank");
}
</script>
</body>

leave.asp:
<%
'assume you saved this user's login name in a session variable
'now remove this user from the online list
'or you can do it in the Session_OnEnd, since the next call will trigger it
Session.Abandon
%>
<body>
Thank you for using our site. Hope you'll visit us again soon.
</body>

Of course, it will be tedious to add onunload event handlers to all pages, but you can certainly add the code to a hidden frame
flyingghost 2001-10-12
  • 打赏
  • 举报
回复
就算会了实时刷新,但这只限于在线的用户,如果有人离线了,服务器端怎样刷新当前在线的人的名单?我现在想做一个类似于webicq的东东,但不会实时反映当前在线用户名单列表,大侠帮我!
karma 2001-10-12
  • 打赏
  • 举报
回复
<script language="vbscript">
setTimeout "window.location.reload true ", 1000, "vbscript"
</script>

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧