Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6746917
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:22:45+00:00 2026-05-26T12:22:45+00:00

function setCountDown () { seconds–; if (seconds < 0){ minutes–; seconds = 59 }

  • 0
function setCountDown ()
{
  seconds--;
 if (seconds < 0){
      minutes--;
      seconds = 59
 }
  if (minutes < 0){
      hours--;
      minutes = 59
 }
  if (hours < 0){
      days--;
      hours = 23
 }
  document.getElementById("remain").innerHTML = hours+" hours, "+minutes+" minutes,      "+seconds+" seconds";
  SD=window.setTimeout( "setCountDown()", 1000 );
  if (minutes == '00' && seconds == '00') { seconds = "00"; window.clearTimeout(SD);
        window.alert("Time is up. Press OK to continue."); // change timeout  message as required
        //window.location = "http://www.yourpage.com" // Add your redirect url
  }

}

function doTimer()
{
  if (!timer_is_on){
  timer_is_on=1;
  setCountDown ();
}
}
function stopCount()
{
  clearTimeout(SD);
  timer_is_on = 0;
}

the problem is the pause working on one page but when i click the next button the page will reload and the truth is the timer never pause. i was wondering how can i pause the timer?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T12:22:46+00:00Added an answer on May 26, 2026 at 12:22 pm

    If I understand you correctly you want to have the state the timer to persist on all the pages so that even if you reload the page the timer is paused or continues counting where it left off ?

    If this is the case a solution would be to send a ajax query to the server, wait for that and then submit the form. Then when you load the new page you use PHP (You have it in your tags) to check the session and echo the right value. So you could save how far the timer was and resume where the user left off on the last page.

    Have a look at PHP Sessions and Ajax with JQuery.

    Hope I understood that correctly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

function check(id){ var _id = document.getElementById(id); url = test.php?check=1&id= + _id; } i want
function ExChgClsName(Obj,NameA,NameB){ var Obj=document.getElementById(Obj)?document.getElementById(Obj):Obj; Obj.className=Obj.className==NameA?NameB:NameA; } <a href=javascript:showMenu(2);> i am a newbie of the
function prepareEventHandlers() { var sectionButton1 = document.getElementById(sectionButton1); var sectionButton2 = document.getElementById(sectionButton2); var sectionButton3 =
Function FillAdminAccount() As Boolean FillAdminAccount = True Try SQLconn.ConnectionString = connect timeout=9999999; & _
function loaded() { document.addEventListener('touchmove', function(e){ e.preventDefault(); }); myScroll = new iScroll('scroller'); } document.addEventListener('DOMContentLoaded', loaded);
function loaded() { document.addEventListener('touchmove', function(e){ e.preventDefault(); }); } loaded(); At certain times I want
function SanitizeInput(input) { input = input.replace(/</g, &lt;); input = input.replace(/>/g, &gt;); return input; }
function validation(reg) { str = document.reg; if (str.name.value == ) { alert(Enter your name);
function has_thumbnail_image(&$post) { $content = $post->post_content; return preg_match('/<img[^>]+src=(.*?)[^>]*>/', $content, $results); } I need a
function all_images(&$post){ $content = $post->post_content; if(preg_match_all('/<img[^>]+src=(.*?)[^>]*>/', $content, $results)){ $i = 0; $count = count($results);

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.