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 9281455
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T18:07:33+00:00 2026-06-18T18:07:33+00:00

I have this countdown timer on my page: http://www.dirtycookie.co . It does not countdown

  • 0

I have this countdown timer on my page: http://www.dirtycookie.co.

It does not countdown unless you refresh the page.

I have the same script working a little differently @ m.dirtycookie.co for reference.

I have this script on my index.php <head>

     <script>
        $(document).ready(function () {

        function countdown() {
        // input new date here
        var newdate = new Date("Mar 01, 2013 20:00:00");
        // input new date here

        //DO NOT TOUCH THE REST UNLESS YOU KNOW JQUERY WELL
        var now = new Date();
        var timeDifference = newdate.getTime() - now.getTime();
        var d = Math.floor(timeDifference / 1000);
        var l = Math.floor(d / 60);
        var b = Math.floor(l / 60);
        var u = Math.floor(b / 24);
        b %= 24; l %= 60; d %= 60;

        if(d < 0){ var d = 0}
        if(l < 0){ var l = 0}
        if(b < 0){ var b = 0}
        if(u < 0){ var u = 0}

        $(".days").html(u);
        $(".hours").html(b);
        $(".minutes").html(l);
        $(".seconds").html(d);

        var timer = setTimeout('countdown()',1000);
        //DO NOT TOUCH THE REST UNLESS YOU KNOW JQUERY WELL
    }
window.onload=countdown ; 
});
</script>

THe firebug error:
ReferenceError: countdown is not defined
http://www.dirtycookie.co/
Line 106
Line 106 is actually: var timer = setTimeout('countdown()',1000);

The HTML for this is here:

    <div class="counter_wrap">

    <!-- Counter Title -->
        <h1>Countdown to Grand-Opening!</h1>

    <!-- Counter Title -->

    <!-- Counter Section -->
        <div class="numbers"><p class="days">23</p><p class="smallfont">Days</p></div>
        <div class="numbers"><p class="hours">19</p><p class="smallfont">Hours</p></div>
        <div class="numbers"><p class="minutes">7</p><p class="smallfont">Minutes</p></div>
        <div class="numbers"><p class="seconds">23</p><p class="smallfont">Seconds</p>

</div>
  • 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-06-18T18:07:35+00:00Added an answer on June 18, 2026 at 6:07 pm

    This might be a problem:

    var timer = setTimeout('countdown()', 1000);
    

    Why just call it like:

    var timer = setTimeout(countdown, 1000);
    

    The string and eval is really unnecessary. Also.

    var timer = setTimeout(countdown(), 1000);
    // is not the same as:
    var timer = setTimeout(countdown, 1000);
    

    In the first one you’re scheduling the output of countdown() be called as a function. In the second one you’re actually countdown (which is what you want).

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

Sidebar

Related Questions

I have been using this script ( http://www.dynamicdrive.com/dynamicindex6/dhtmlcount.htm ) for countdown to vacations. But
I am using the jquery countdown timer here http://www.littlewebthings.com/projects/countdown/ and I have found that
I have a this working countdown timer in jQuery but for now I'm just
so I have this countdown timer I created, <script type=text/javascript> var interval; var minutes
I have a timer to refresh the page, and it's working: updateCountdown = function()
So I have this script (a countdown timer that closes the '#fb-popupdiv' div, when
Have this self-made slider: http://jsfiddle.net/wyc3P/4/ What it does: takes min and max values in
In my web page, I have a countdown timer using Javascript's setTimeout() . function
I have modified this countdown script to countdown to 4:20pm everyday. I have attempted
I have the script needed to generate a countdown timer that has a start

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.