日期:2014-05-18  浏览次数:20582 次

求助:关于新有信息自动弹出的问题{已有代码}
按照以下代码测试却没有成功,请高手指教!


<html>
<head>
< http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></title>
<sc ript language="java">
re()
{
setTimeout("re()",30000);
ipopmsg.location.href=" search.asp"
}
</sc ript>
</head>
<body topmargin="0" leftmargin="0" ="re();" >
<i height="1" scrolling="no" border="0" width="1" id="ipopmsg" src=" blank"></i> 
</body>
</html>

这个页面的功能是没隔30000毫秒刷新一次search.asp这个页面。下面是search.asp的代码

<head>
<%
set rs=server.createobject("adodb.recordset")
sql="select id from XXXX where xxxx"
rs.open sql,conn,3,2
if not rs.eof then
%>
 <sc ript language="java">
  newwin=open ("new.asp?id=<%=rs("ID")%>","","top=50,left=50,width=420,height=262,menubar=no,status=no,scrollbars=yes,location=no,toolbar=no")
  newwin.focus();
 </sc ript>
<%
end if
rs.close
set rs=nothing
connend
%>
</head>


------解决方案--------------------
ipopmsg 是框架的名字么?


<body topmargin="0" leftmargin="0" ="re();" > ??

<body topmargin="0" leftmargin="0" onload=re();> ?????

需要确保 search.asp 本身没有问题!!

js的re方法也要测试:


re() 

setTimeout("re()",30000); //测试时可以改小这个间隔值 
top.ipopmsg.location=" search.asp";
alert("haha"); 




------解决方案--------------------
lz可能混淆了setTimeout与setInterval 的用法
setTimeout("re()",3000)过3秒钟运行一次re函数
setInterval("re()",3000) 每隔3秒钟执行一次re函数

------解决方案--------------------
同意楼上的说法。

楼主应该看看,setTimeout()和setInterval()函数的区别。
setTimeout()是三秒后只执行一次rs()函数,
setInterval()是每三秒执行一次rs()函数。
------解决方案--------------------
探讨
按照兄弟们提供的方法综合了下,没有成功!

具体:
1, <body topmargin="0" leftmargin="0" onload=re();> //有提示没有对象!
2,.re()
{
setTimeout("re()",30000); //测试时可以改小这个间隔值
top.ipopmsg.location=" search.asp";
alert("haha"); //本身好象没有自动刷新功能!
}

3, search.asp 没有问题!

<!--#include file="db.asp"-->
<!--#include file="sqlstr.…