用Asp如何实现防止网页频繁刷新?
程序员文章站
2023-11-13 15:11:10
<% dim refreshintervaltime ref...
<%
dim refreshintervaltime
refreshintervaltime = 3 '防止刷新的时间秒数,0表示不防止
if not isempty(session(“visit“)) and isnumeric(session(“visit“)) and int(refreshintervaltime) > 0 then
if (timer()-int(session(“visit“)))*1000 < refreshintervaltime * 1000 then
response.write (“<meta http-equiv=““refresh““ content=“““& refreshintervaltime &“““ />“)
response.write (“刷新过快,请稍候“)
session(“visit“) = timer()
response.end
end if
end if
session(“visit“) = timer()
%><!doctype html public “-//w3c//dtd html 4.01 transitional//en“>
<html>
<head>
<title>asp如何防止网页频繁刷新-wwww.zhangpeng.com.cn</title>
<meta http-equiv=“content-type“ content=“text/html; charset=gb2312“>
<link rel=“stylesheet“ type=“text/css“ href=“style.css“>
<style type=“text/css“>
</style>
</head>
<body style=“background-color:#666666;font-size:36pt;font-family:黑体;color:#ffffff;“>
asp如何防止网页频繁刷新-www.zhangpeng.com.cn
</body>
</html>
dim refreshintervaltime
refreshintervaltime = 3 '防止刷新的时间秒数,0表示不防止
if not isempty(session(“visit“)) and isnumeric(session(“visit“)) and int(refreshintervaltime) > 0 then
if (timer()-int(session(“visit“)))*1000 < refreshintervaltime * 1000 then
response.write (“<meta http-equiv=““refresh““ content=“““& refreshintervaltime &“““ />“)
response.write (“刷新过快,请稍候“)
session(“visit“) = timer()
response.end
end if
end if
session(“visit“) = timer()
%><!doctype html public “-//w3c//dtd html 4.01 transitional//en“>
<html>
<head>
<title>asp如何防止网页频繁刷新-wwww.zhangpeng.com.cn</title>
<meta http-equiv=“content-type“ content=“text/html; charset=gb2312“>
<link rel=“stylesheet“ type=“text/css“ href=“style.css“>
<style type=“text/css“>
</style>
</head>
<body style=“background-color:#666666;font-size:36pt;font-family:黑体;color:#ffffff;“>
asp如何防止网页频繁刷新-www.zhangpeng.com.cn
</body>
</html>
下一篇: 解决使用良精企业建站7.0未注册问题