Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jun 2010
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Javasript Auto Update Function?

    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.

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,081
    Thanks
    203
    Thanked 2,542 Times in 2,520 Posts
    Quote Originally Posted by jeanrigole View Post
    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

  • #3
    New to the CF scene
    Join Date
    Jun 2010
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Thank you , I will go try those. I don't know why I didn't think about them before.


  •  

    Posting Permissions

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