jquery “everyTime” function

前端 未结 3 1466
陌清茗
陌清茗 2020-12-06 14:52

I\'m trying to refresh my recent list every 5 seconds. I was looking at ajax and found jquery.

I found a function known as \"everyTime\"

This is what I have

3条回答
  •  既然无缘
    2020-12-06 15:28

    5s is neither an integer or a string, and so it's an invalid input. To achieve the desired behavior you can use an integer number of milliseconds:

    $(document).everyTime(5000, function(i) {
      
    }, 0);
    

    or a string indicating the interval:

    $(document).everyTime('5s', function(i) {
      
    }, 0);
    

    (here's a reference)

提交回复
热议问题