Results 1 to 3 of 3

Thread: Execute function every minute

  1. #1
    Join Date
    Jan 2009
    Posts
    82
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default Execute function every minute

    I'm using this code but it only runs the function once

    Code:
    <body onLoad="setTimeout(function(){ajaxFunctionas('34');}, 60000)">
    is there a way to have this function keep running every minute?

  2. #2
    Join Date
    Jan 2009
    Posts
    82
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default

    setInterval did it!

  3. #3
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    setTimeout should work, but it's a one time event-- you could put that in a loop (so it sets a new timeout each time you end one). setInterval should be easier. Glad you found it.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

Bookmarks

Posting Permissions

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