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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T17:12:57+00:00 2026-05-24T17:12:57+00:00

After spending the last 45 minutes looking around for a solution, I can’t seem

  • 0

After spending the last 45 minutes looking around for a solution, I can’t seem to find an easy solution to creating a countdown timer using PHP and jQuery. Most already built scripts I’ve found are based purely on jQuery which require a ton of code, and more parameters then they should, plus, adaptability is pretty hard.

Here’s my situation;

PHP:

$countdown = date("h:i:s"); // This isn't my actual $countdown variable, just a placeholder

jQuery:

$(document).ready(function name() {
    $("#this").load( function() {  
        setTimeout("name()", 1000)
      }
    }
});

HTML:

<div id="this"><?php echo($countdown); ?></div>

My idea is that, every second, #this is reloaded, giving a new value to it’s contents, and as $countdown isn’t a static variable, a new value will be loaded each time. This removes the need to deal with sessions (as a basic javascript countdown timer would reset on pageload, etc).

I would’ve though this would have worked, until I realized that the event binder .load() doesn’t reload #this (I know silly me), so I guess what I’m wondering is – is there an event binder I can use to make this work or is there a way to get the functionality I’m looking for, without using a jQuery plugin (which doesn’t match exactly what I want anyway)?

  • 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-24T17:12:58+00:00Added an answer on May 24, 2026 at 5:12 pm

    You should use Keith Wood’s countdown timer: http://keith-wood.name/countdown.html

    It is extremely easy to use.

    All you have to do is

    $('#timer').countdown({
        until: '<?php echo date("h:i:s"); ?>' // change this, obviously
    });
    

    Here’s the fiddle: http://jsfiddle.net/tqyj4/289/

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

Sidebar

Related Questions

After spending quite a bit of time trying to design my way around the
after spending hours of figuring out how to sign an app (at last i
I'm trying to learn python after spending the last 15 or so years working
After spending the last few months learning about MATLAB, it seems I need to
After spending three weeks learning Objective-C and Cocoa programming for my work, I've been
After spending a miserable month with MySQL/.NET/EntityFramework, my findings: Support for Entity Framework is
After spending some time wireframing my ideas, I want to start building my rails
How to migrate to *nix platform after spending more than 10 years on windows?
After becoming somewhat estranged open source, and spending some years developing web applications in
Connect function returns after sending the last ACK(3rd segment of 3-way handshake of initiating

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.