Calling a function every 60 seconds

后端 未结 13 2061
情书的邮戳
情书的邮戳 2020-11-22 08:24

Using setTimeout() it is possible to launch a function at a specified time:

setTimeout(function, 60000);

But what if I would l

相关标签:
13条回答
  • 2020-11-22 09:25

    use the

    setInterval(function, 60000);
    

    EDIT : (In case if you want to stop the clock after it is started)

    Script section

    <script>
    var int=self.setInterval(function, 60000);
    </script>
    

    and HTML Code

    <!-- Stop Button -->
    <a href="#" onclick="window.clearInterval(int);return false;">Stop</a>
    
    0 讨论(0)
提交回复
热议问题