Run a JavaScript function continuously repeating with a time interval

前端 未结 5 1681
南方客
南方客 2021-02-06 15:31

This is my first question, and I would appreciate you answering soon.

I would like code to repeat a function continuously... I have tried some code but it hasn\'t worked

5条回答
  •  时光取名叫无心
    2021-02-06 16:38

    How about some good ol' fashion recursion?

    function getStuff() {
        $('#more').load('exp1.php', function() {
            getStuff();
        });
    }
    
    getStuff();​
    

    Demo:
    http://jsfiddle.net/Zn2rh/1/

提交回复
热议问题