Run a JavaScript function continuously repeating with a time interval

前端 未结 5 1685
南方客
南方客 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:35

    Just throwing it out there:

    function doRequest() {
    $.ajax({
      url: 'exp1.php',
      timeout: 1000,
      success: function(data) {
        $('#more').html(data);
        doRequest();
      }
    });
    }
    

提交回复
热议问题