ASP

ASP页面防止刷新

<%
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("呵呵,老朋友,您点得实在太快了,我会很累的啊,为了能更好的为您服务,请不要在3秒内连续点击*^_^*。谢谢您的关心!正在打开页面,请稍候……")
        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 防止网页频繁刷新一法</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;">  页面内容,页面内容  
<%=timer()%>
</body>
</html>
分类: ASP

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理

相关文章

开始在上面输入您的搜索词,然后按回车进行搜索。按ESC取消。

返回顶部