?
Solved

JavaScript Countdown Timer:  Need To Count Down and Then Redirect The User

Posted on 2006-03-21
4
Medium Priority
?
231 Views
Last Modified: 2012-05-05
Hey Everyone,

I'm sure this is already out there but it has been harder then I thought it would be to locate just what I am looking for.  I'm testing with my site and I've got a full screen window that has 2 frames...top.cfm and bottom.cfm in the frameset.cfm frame.  On the top frame, I need to count down from 1 hour and 30min to 0 where 0 is when the test time is up for the student and they are redirected to another webpage.

Who's got a nice and easy fuction that can be configured pretty easily...

Thanks a lot,
inverted_2000
0
Comment
Question by:inverted_2000
2 Comments
 
LVL 2

Author Comment

by:inverted_2000
ID: 16258208
Anyone today have a time left counter for me?
0
 
LVL 49

Accepted Solution

by:
Roonaan earned 2000 total points
ID: 16354889
You can use

setInterval('mycountdownfunction()', 1000); //1000 ms = 1 second

Then have:

var numberofseconds = 60 * 90;
function mycountdownfunction() {
  numberofseconds--;
  if(numberofseconds <= 0) {
     do something
  }
}

However, you should also keep track of time serverside, as javascript could be bypassed by inventive users.

-r-
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

750 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question