Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to delay response.redirect?

Status
Not open for further replies.

vinzpom

Programmer
Oct 15, 2002
11
PH
im just a beginner, can you please help me in this matter..
 
[tt]

Here you go, this script is set to delay the page 15 seconds but of course it can be changed.


<HEAD>

<SCRIPT LANGUAGE=&quot;JavaScript&quot;>

redirTime = &quot;15000&quot;;
redirURL = &quot;your_page.asp&quot;;
function redirTimer() { self.setTimeout(&quot;self.location.href = redirURL;&quot;,redirTime); }
</script>


<!-- STEP TWO: Insert the onLoad event handler into your BODY tag -->

<BODY onLoad=&quot;redirTimer()&quot;>


Got ASP Error(s)? =
 
If you want to keep the delay Server-Side try this:


<%
Dim T, X

T = Timer + 10
X = Timer

Do while Left(T, Len(T)-3) <> Left(X, Len(X)-3)

X = Timer

Loop

Response.Redirect(&quot;default.asp&quot;)

%>

HTH
 
Delaying the server side that way though does not put anything up on the screen so they would just seem to be waiting to download the page. If thats what you want then thats the way to go but if you want to show a page then its better to use the http-equiv meta tag.

James :) James Culshaw
james@miniaturereview.co.uk
 
thanks for your help.. ill try for both scripts you gave me..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top