页面延迟的两个简单方法

一、

1 Response.Buffer = True 
 1   
 2' Setup the variables necessary to accomplish the task   
 3Dim TimerStart, TimerEnd, TimerNow, TimerWait   
 4' How many seconds do you want them to wait...   
 5TimerWait = 5   
 6' Setup and start the timers   
 7TimerNow = Timer   
 8TimerStart = TimerNow   
 9TimerEnd = TimerStart + TimerWait   
10' Keep it in a loop for the desired length of time   
11Do While (TimerNow < TimerEnd)   
12' Determine the current and elapsed time   
13TimerNow = Timer   
14If (TimerNow < TimerStart) Then   
15TimerNow = TimerNow + 86400   
16End If   
17Loop   
18' Okay times up, lets git em outa here   
19Response.Redirect "nextpage.html" 

二、

 1   
 2Sub TimeDelaySeconds(DelaySeconds)   
 3SecCount = 0   
 4Sec2 = 0   
 5While SecCount < DelaySeconds + 1   
 6Sec1 = Second(Time())   
 7If Sec1 <> Sec2 Then   
 8Sec2 = Second(Time())   
 9SecCount = SecCount + 1   
10End If   
11Wend   
12End Sub   

' To change delay adjust here

1 TimeDelaySeconds(2) 
Published At
Categories with Web编程
comments powered by Disqus