Results 1 to 2 of 2

Thread: how to refresh a page in javascript at each second

  1. #1
    Join Date
    Jan 2011
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question how to refresh a page in javascript at each second

    hi i am new to javascript,
    i need help,
    i have an event which should be called in the if statment,when the database time and the current time are equal that event would be called,
    i get bath the times but how i generate this event in javascript when both the time are matching,

    if($dbtime==&currenttime){
    eventhandler();
    }
    this would be called if it rrefresh through javascript at every second

  2. #2
    Join Date
    Oct 2009
    Posts
    845
    Thanks
    14
    Thanked 189 Times in 188 Posts

    Default

    Hi, maybe you can use this:

    Code:
    <script type=text/javascript>
    setTimeout('document.location=document.location' ,1000);
    </script>
    or

    Code:
    <script type=text/javascript>
    setTimeout('window.location=window.location' ,1000);
    </script>
    Last edited by azoomer; 01-28-2011 at 07:43 AM. Reason: Changed from 1 minute to 1 second + update

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •