自動刷新頁面問題

wangfeifei812 2003-08-11 08:39:40
我用以下代碼自動刷新頁面的時候狀態欄總是有一條籃色的刷新條,望大家help me.
如何消去那刷新條.
<meta http-equiv="refresh" content="5;url=test.asp">
...全文
34 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
杨小杨 2003-08-13
  • 打赏
  • 举报
回复
调试通过那就要结贴啊!
wangfeifei812 2003-08-13
  • 打赏
  • 举报
回复
呵呵,謝謝你們了,你們真是高手呀,調試已經通過。哈,有問題我就來請教你們了。
杨小杨 2003-08-12
  • 打赏
  • 举报
回复
贴个例子!

无刷新更新

main.asp内容如下

<script language=javascript>
<!--
function sendData()
{
var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
xmlhttp.Open("get", "do.asp", false);
xmlhttp.Send();
maindata.innerHTML=bytes2BSTR(xmlhttp.responseBody);
window.setTimeout("sendData()",5000);
}
-->
</script>

<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
-->
</script>

<body>
<div id=maindata>数据加载中,请稍候····</div>
<script language=javascript>
<!--
sendData();
-->
</script>
</body>

do.asp内容如下:

<%
response.expires=0
%>
<table><tr><td><%=now()%></td></tr></table>测试中文(时间变化)

win2000+IIS5.0+ie6.0中调试通过!
fason 2003-08-12
  • 打赏
  • 举报
回复
使用xmlhttp更新需要更新的地方
杨小杨 2003-08-12
  • 打赏
  • 举报
回复
使用settimeout加客户端脚本。使用无刷新更新页面!
  • 打赏
  • 举报
回复
<script>
<!--
var limit="2:00"
'2分钟刷新一次
if (document.images){
var parselimit=limit.split(":")
parselimit=parselimit[0]*60+parselimit[1]*1
}
function beginrefresh(){
if (!document.images)
return
if (parselimit==1)
window.location.reload()
else{
parselimit-=1
curmin=Math.floor(parselimit/60)
cursec=parselimit%60
if (curmin!=0)
curtime=curmin+"分"+cursec+"秒后重刷本页!"
else
curtime=cursec+"秒后重刷本页!"
window.status=curtime
setTimeout("beginrefresh()",1000)
}
}
window.onload=beginrefresh
//-->
</script>

换成这种代码

放在 <body></body>之间

28,391

社区成员

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

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