Results 1 to 2 of 2

Thread: clock

  1. #1
    silent1 Guest

    Default clock

    I have just created a clock in javascript, but it doesn&#039t run it just displays the time. Is there a way to make it run?

  2. #2
    Join Date
    Dec 1969

    Default RE: clock

    Well, you need to keep calling the script that displays the clock. To do that, you need to use the function setInterval() as follows,<BR><BR>var clockID = setInterval(expression,msecs)<BR><BR>Starts the timer that continually invokes the expression every msecs. Other scripts can run in the time between calls to expression. The time is specified in milliseconds.<BR><BR>To stop the looping timer, use the following line in conjunction with the above code,<BR><BR>clockID.clearInterval()<BR>

Posting Permissions

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