Jump to content
Sign in to follow this  
SandySynaptik

Creating a Countdown Timer

Recommended Posts

I have been creating a redirect page but now also want to include a timer to set a time of 3 secs. [or something]. It should be something like:

You will be redirected to example.php in "timer" secs.
How do I do so?

Share this post


Link to post
Share on other sites

If you want to display an updating timer, that's JavaScript. This tutorial can get you started. Try adapting it. If you get stuck, come back with a question.

Share this post


Link to post
Share on other sites
I have been creating a redirect page but now also want to include a timer to set a time of 3 secs. [or something]. It should be something like:How do I do so?
if all you want to do is send somebody to your new page after 3 seconds, you can use a meta tag in the header. Here is a sample form one of my sites
<META HTTP-EQUIV=Refresh CONTENT="3; URL=http://besidethetrail.ca/directions.html">

Apparently this is not the best solution because it BREAKS the back button. But in the case of a permanent redirect I find it is a quick fix that allows you to say "adjust your bookmarks, we have moved."Guy

Edited by Guy Cousineau

Share this post


Link to post
Share on other sites

Building on Guy's idea:Using JavaScript to change the window.location object should not break the back button. Since everyone does not enable JavaScript, one technique is to set the JavaScript mechanism to fire after, say, 3 seconds, and set the <meta refresh> tag to fire after 4 seconds. That way, most users will keep their backbutton functionality, and the refresh process will only affect those few who disable JavaScript.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...