![]() Topic awaiting preservation: run function every 60 seconds? (Page 1 of 1) |
|
---|---|
Paranoid (IV) Inmate From: Northumberland, England |
![]() 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 |
![]() learn to use google |
Paranoid (IV) Inmate From: NZ |
![]() Hum, this will be interesting to me. |
Paranoid (IV) Inmate From: Northumberland, England |
![]() Thanks for the sarcasm-type wit there bitdamaged |
Paranoid (IV) Inmate From: everywhere |
![]() 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 |
![]() 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 |
![]() 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 |
![]() 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 |
![]() 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 |
![]() 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. |