I have a designed a small mock test in web application. I have tried to use javascript countdown timer, But no use, when every time I clicked the next or previous button the page refreshed and the timer reset to beginning. Any way I can use the live timer from jsp or servlet. Please assit me
You *are* using a timer. What you're not realizing is how browsers and JavaScript work--a page's JavaScript only lives as long as that page is loaded. Load a new page, you're starting "from scratch".
Meet Gaurav
Ranch Hand
Joined: Oct 08, 2008
Posts: 492
posted
0
David,
I realize the issue.. Thats why am posting here for help
I think, storing the time in the session and passing it (displaying) on webpage and decrementing it using javascript, and when "next" is clicked resending (new value) back also has one advantage, the time it takes during trasit (next page load) is not lost. I think it is ideal way than using an IFRAME where it keeps on ticking even when the page is not yet loaded!
Meet Gaurav
Ranch Hand
Joined: Oct 08, 2008
Posts: 492
posted
0
Added 2 setter and getter for min and secs in form bean.. Now it's working perfectly.. Thanks for all your support