asp是否可以实现像浏览器中的“刷新按钮”一样“自动”刷新页面?
不是简单的用<metahttp-equiv="refresh"content="20">方法。谢谢!...
不是简单的用<meta http-equiv="refresh" content="20">方法。谢谢!
展开
1个回答
展开全部
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>计时器</title>
<script language="VBScript">
targettime = dateadd("s",10,now()) '//s是秒 10 是刷新时间
function aa()
bb = datediff("s",now(),targettime)
if bb > 0 then
document.all.showa.innerText = bb&" s."
setTimeout "aa()",100
else
window.location.reload()
'document.getElementsByName("showa")(0).innerText = "time out." '
end if
end function
</script>
</head>
<body onload="aa()">
<span id="showa"></span>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>计时器</title>
<script language="VBScript">
targettime = dateadd("s",10,now()) '//s是秒 10 是刷新时间
function aa()
bb = datediff("s",now(),targettime)
if bb > 0 then
document.all.showa.innerText = bb&" s."
setTimeout "aa()",100
else
window.location.reload()
'document.getElementsByName("showa")(0).innerText = "time out." '
end if
end function
</script>
</head>
<body onload="aa()">
<span id="showa"></span>
</body>
</html>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询