欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

用Asp如何实现防止网页频繁刷新?

程序员文章站 2022-07-12 08:16:46
<%     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>