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

  • SEARCH
  • Home
  • 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 8820917
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:43:35+00:00 2026-06-14T05:43:35+00:00

jQuery(document).ready(function() { function updateTime() { $(#wtime).append(‘<p>Wacht nog: <?php echo $wait_time; ?></p> ‘); } updateTime();

  • 0
jQuery(document).ready(function() {
function updateTime() {
    $("#wtime").append('<p>Wacht nog: <?php echo $wait_time; ?></p> '); 
}

updateTime();
setInterval(updateTime, 1000); });

I want to update the div #wtime every second now it only shows the time and is not updating it

  • 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-14T05:43:36+00:00Added an answer on June 14, 2026 at 5:43 am

    You have to parse the time you get from the server into a javascript Date() object and then increment that each second.

    Here’s a working fiddle:

    // Make sure $wait_time has a valid format so that Date() can parse it.
    // var serverTime  = new Date('<?php echo $wait_time; ?>');
    var serverTime = new Date();
    
    function updateTime() {
        /// Increment serverTime by 1 second and update the html for '#time'
        serverTime = new Date(serverTime.getTime() + 1000);
        $('#time').html(serverTime.toGMTString());
    }
    
    $(function() {
        updateTime();
        setInterval(updateTime, 1000);
    });​
    

    Related HTML:

    <div id="wtime">
        <p>Wacht nog: <span id="time"></span></p>        
    </div>​
    

    Hope it helps.

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

Sidebar

Related Questions

jQuery(document).ready(function(){ var panelContainer = jQuery('div#panels'); jQuery('<div id=tabs></div>').insertBefore(panelContainer); panelContainer.find('div.panel').each(function(n){ jQuery('div#tabs').append('<a class=tab href=#' + (n+1) +
Here is client Side code: jQuery(document).ready(function(){ jQuery(#list).jqGrid({ url:'example.php', datatype: 'xml', mtype: 'GET', colNames:['Inv No','Date',
I have the following function: jQuery(document).ready(function($){ $(div.findButton).click(function(){ UidID=Math.floor(Math.random()*1000); PostCode=$(#postcode).val(); $.get(result.php, {postcode: PostCode,uid:UidID}, function(response){ $(#result).html(response);
The following code: jQuery(document).ready(function($) { function getBooks() { var query = ajax.php?do=allbooks; $.ajax({ dataType:
jQuery(document).ready(function(){ $(#button).submit(function() { { var email_id=document.getElementById('textfield').value; var password=document.getElementById('textfield2').value; var utype=document.getElementById(utype).value; var url=login_check.jsp?&email_id=+encodeURIComponent(email_id)+&password=+encodeURIComponent(password)+&utype=+encodeURIComponent(utype); $('form').get(0).setAttribute('action',url); alert(document.form1.action);
On document ready I run this code: jQuery(document).ready(function(){ jQuery('#button').click(function() { jQuery('#contact_form').load(/Users/mge/Downloads/jquery-ajax-1/readme.txt); return false; });
load.js: jQuery(document).ready(function($) { $('.dialog ul li').click(function(e) { switch($(this).attr('id')) { case 'addProject': $('.addDialog').load('/add/addprojectform'); break; case
I am using a jQuery Class plugin as so : jQuery(document).ready(function($) { window.SSK.calendar =
I was hoping someone could help me with the following script: jQuery(document).ready(function($) { $(.infoBoxBtn
This is my jQuery code <script type=text/javascript> jQuery(document).ready(function($){ $(#'.$tag.').dcFlickr({ limit: '.$nFlickr.', style: thumb, q:

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.