关于弹出窗口的问题。急~~~~~ 高分 求助啊!

thomson118 2002-12-14 10:49:25
我在数据库中设了一个 “重要通知”(zytz) 字段,如果该字段有新的记录添加进去了,就在首页显示出新添加的通知,请问各位该怎么做呢???我想就只有隔一分钟或固定时间查一下数据库的该字段是否有添加,如果有的话弹出新的窗口,
可是我不知道该怎么做,请各位帮我这个忙解决这个问题啊。
...全文
42 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
林仪明 2002-12-14
  • 打赏
  • 举报
回复
这样子,你在页面里加一个iframe,这个iframe每隔一定时间就刷新一次,读取数据。有的话就显示没有就不显示!
就像csdn的这个论坛,你有消息的话,就会在右边顶部的菜单条显示。
这是他的代码(不是asp的)
注意第三行:
<html>
<head>
<meta http-equiv="Refresh" content="1000;URL=/expert/deeptree/contentbar.asp?myie=ie">
<META NAME="Robots" CONTENT="noindex">
<meta content="text/html;charset=gb2312" http-equiv="Content-Type">
<TITLE>Deeptree Content Bar</TITLE>
<LINK REL="stylesheet" TYPE="text/css" HREF="/csdn.css">
<script src="/Expert/style/get_css.js"></script>
</head>
<script language="javascript">
if (top.location == self.location)
{
top.location.href = "/Expert/Forum.asp";
}

function selectstart()
{
window.event.cancelBubble = true;
window.event.returnValue = false;
return false;
}
function GoToURL(strX)
{
if (strX == "" || strX == null || strX == "undefined")
{
return;
}
window.top.location.href = strX;
}
function mylogin(url)
{
window.parent.parent.location = url+"&from="+window.parent.parent.location.pathname+"&Roomid=&typenum=&tabletype=&searchKeys=&author=&whichpage=";
}
function mylogin2(url)
{
window.open(url+"&from="+window.parent.parent.location.pathname);
newMessage.style.visibility = "hidden";
}
function loginsub()
{
document.login.submit();
}
//-->
</SCRIPT>
<body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0" class="color3">
<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<tr>
<td align="left" VALIGN="top" width="100%" NOWRAP>

<div id="showtoc" name="showtoc" style="display:none;">

<table onclick="top.dtbar.showtoc();" align="left" border=0 cellpadding=0 cellspacing=0 title="显示菜单" style="cursor:hand">
<tr>
<td height="30"></td>
<td height="30" valign="middle"><img title="显示菜单" border="0" src="/expert/deeptree/images/showtoc.gif" /></td>
<td height="30"></td>
<td height="30" valign="middle"><a href="#"><font face="verdana" color="#FFFFFF">显示菜单</font></a></td>
</tr>
</table>
</div>
<table border="0" width="100%">
<form method="post" action="/member/logon.asp" target="_top" name="login">
<script>
document.write("<input type='hidden' name='from' value='")
document.write(parent.parent.location)
document.write("'>")
</script>
<tr><td valign="top">
<font color="#ffffff">

<img src="/images/1d.GIF" width="19" height="15">欢迎您:lins
<img src="/images/1d.GIF" width="19" height="15">可用分:7192
<img src="/images/1d.GIF" width="19" height="15">总信誉分:100
<img src="/images/1d.GIF" width="19" height="15"><a href="/member/logonout.asp" target="_top"><font color="#ffffff">注销我的登录</font></a>
</td><td>

</font>
</td></tr></form></table></td></tr></table>
</body>
</html>
yyf_321 2002-12-14
  • 打赏
  • 举报
回复
我想只要在文件头中设置让他每一分钟刷新一次就行啦,
内,至于内容的话你只要判继新取的ID 号是否和旧的ID 相同就行啦,
可以这样做:先把取得的ID号放在SESSION 中,当刷新时他又会取得ID号,判继
ID=SESSION("ID") 如果是的话弹出新的窗口,并把ID值赋给SESSION
记得每次只能取最新的一条记录,好像是用TOP() 吧

28,390

社区成员

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

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