Topic awaiting preservation: run function every 60 seconds? |
|
---|---|
Author | Thread |
Paranoid (IV) Inmate From: Northumberland, England |
posted 05-16-2003 02:02
How do I make a function call repeat itself every 60 seconds and update the page display without refreshing/reloading the document? Is that a setTimeout thing? How does that work? |
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
posted 05-16-2003 04:28
learn to use google |
Paranoid (IV) Inmate From: NZ |
posted 05-16-2003 04:55
Hum, this will be interesting to me. |
Paranoid (IV) Inmate From: Northumberland, England |
posted 05-16-2003 22:38
Thanks for the sarcasm-type wit there bitdamaged |
Paranoid (IV) Inmate From: everywhere |
posted 05-17-2003 00:26
The meat of this is almost entirely copied from that lycos page (although I knew about these things before, I just thought it might make more sense to you then). |
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
posted 05-17-2003 00:56
Look I hate RTFM questions as much as anyone but for general questions like that it's better to try something and then give us a more specific problem than have us try to write a setTimeout tutorial that wouldn't be as good as something that has probably already been covered better by someone else. code: function hello() {
|
Paranoid (IV) Inmate From: Northumberland, England |
posted 05-17-2003 01:22
quisja: I tried that already, but it didn't work so I thought I'd done it wrong. It doesn't work. |
Paranoid (IV) Inmate From: Northumberland, England |
posted 05-17-2003 04:27
bitdamaged: your version is working to some extent, but how do I get the function to loop the arguments that were submitted by the function call in the page? at the moment the arguments submitted from the page only go through the function the first time and then when the setTimeout thing starts the function again it throws out an error - if I leave the argument brackets empty then after the setTimeout thing kicks in the age turns into NaNs, and other way's I've tried don't work either. |
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
posted 05-17-2003 07:07
You need to pass the arguments to the function in the setTimeout But since it's a quoted string it gets a bit strange. I don't know what you have named the variables in your function so I'm guessing. What it should look like is this (I only went through day but you get the point) |
Paranoid (IV) Inmate From: Northumberland, England |
posted 05-17-2003 16:22
thanks bitty, that works great - I had tried that way myself, but never unquoted the variables/arguments in the string, it's these simple things that confuse newbies like myself. |