...

View Full Version : Javasript Auto Update Function?



jeanrigole
06-16-2010, 09:48 AM
Hi everyone. I've managed to create everything to work correctly using javascript on my site, except I'm trying to find a way so that a certain function is called on non-stop. Or at least every time the mouse moves.

The site is http://www.goformat.com/ What I'm trying to do is make it so that the words, characters, and lines counter at the top of the text area updates on its own. Right now, it updates onkeyup. However, when you click a button, to say, delete all the letters, they don't update unless you do another onkeyup action. The function that updates the words, characters, and lines is "countall()". so i tried putting a onfocus="countall()" and also a onmouseout="countall()" with one of the buttons, But none of it is working.

Is there some kind of javascript code that sets the page to keep performing a function after a set amount of time? Or at least one that will work with the buttons so that the "countall()" function is called on after pushing a button?

Thanks you very much everyone for the help, any suggestions are very much appreciated.

Philip M
06-16-2010, 11:42 AM
Is there some kind of javascript code that sets the page to keep performing a function after a set amount of time?

Look at setTimeout() and setInterval().

We've been hit by a tornado from our own submarine. - Radio 5 Live

jeanrigole
06-16-2010, 04:25 PM
Thank you :D , I will go try those. I don't know why I didn't think about them before. :confused:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum