![]() Topic awaiting preservation: Javascript clock only updates when page reloads (Page 1 of 1) |
|
|---|---|
|
Bipolar (III) Inmate From: 54'0"N, 1'33"W |
posted 12-11-2004 21:45
I'm using the following code on a website to produce a clock: code: <script language="JavaScript" type="text/javascript">
|
|
Maniac (V) Inmate From: Boston, MA, USA |
posted 12-11-2004 22:09
I'm thinking you need to wrap what you have in a function, and use settimeout to invoke that function every second. |
|
Maniac (V) Lord Mad Scientist Sovereign of all the lands Ozone and just beyond that little green line over there... From: San Diego, California |
posted 12-11-2004 22:37
Yah, place that whole script inside a function, like... |
|
Bipolar (III) Inmate From: 54'0"N, 1'33"W |
posted 12-11-2004 22:45
Thank you very much sir, and may I say it is a great honour to have you reply to my thread, Mr. Ozone sir... |
|
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
posted 12-12-2004 01:20
|
|
Paranoid (IV) Inmate From: France |
posted 12-12-2004 01:27
|
|
Maniac (V) Lord Mad Scientist Sovereign of all the lands Ozone and just beyond that little green line over there... From: San Diego, California |
posted 12-12-2004 08:03
Subtle and sly, he slinks back to the forum! Heh. I thought about saying something, but it just seemed easier to talk about clocks. |
|
Bipolar (III) Inmate From: f(x) |
posted 12-12-2004 10:06
|
|
Paranoid (IV) Mad Librarian From: Berlin |
posted 12-12-2004 12:45
When I came across the first post yesterday before going to bed, I thought it must be some kind of joke. But now here's another one, and he almost feels real, so what can I say.... |
|
Maniac (V) Mad Librarian From: the space between us |
posted 12-12-2004 13:24
|
|
Bipolar (III) Inmate From: 54'0"N, 1'33"W |
posted 12-12-2004 15:35
Based on what you wrote, I now have this: code: <script language="JavaScript" type="text/javascript">
code: <font color='#000000' face='verdana' font size='1'><span id="theTime"></span></font>
|
|
Paranoid (IV) Mad Librarian From: Berlin |
posted 12-12-2004 16:14
The setup() function needs to be seperate from the timeSet() one, and you should set window.onload to setup() outside of a function, as well. Only that way, it and the setup() function will be called automatically when the page loads, which in turn will then activate the setInterval for timeSet(). |
|
Bipolar (III) Inmate From: 54'0"N, 1'33"W |
posted 12-12-2004 18:22
Hallelujah, it works! |
|
Maniac (V) Lord Mad Scientist Sovereign of all the lands Ozone and just beyond that little green line over there... From: San Diego, California |
posted 12-13-2004 08:19
Hah! You guys, you make me blush almost! Really, ask any of the old farts, I'm luggin' around feets of clay, so to speak, and am quite the... just a guy. =) mas, I got your pm, but I'm still off in a place, so's I didn't get a chance to mess you back. Congratulations AlterEgo! Glad it's working, how about a link to check it out, eh? |
|
Maniac (V) Mad Scientist From: Somewhere over the rainbow |
posted 12-13-2004 08:25
The poster has demanded we remove all his contributions, less he takes legal action. |
|
Maniac (V) Inmate From: Boston, MA, USA |
posted 12-13-2004 15:58
Good to have you amongst us Doc. Quite the little bombshell, your abrupt appearance. Makes me feel it's okay once again to believe in Santa Clause and the Easter Bunny too. |
|
Paranoid (IV) Inmate From: schillmania.com |
posted 12-15-2004 21:01
I have to add my two cents in this also! I think in the near-three years I've been hanging around this forum, I've only seen posts from the Doc on a few different occasions - so it's nice to hear from you again! |
|
Bipolar (III) Inmate From: 54'0"N, 1'33"W |
posted 12-16-2004 17:50
quote:
|