jquery “everyTime” function

前端 未结 3 1471
陌清茗
陌清茗 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:38

    You can use everyTime plugin with jQuery Ajax like this:

    var j = jQuery.noConflict();
    j(document).ready(function()
    {
        j(".refresh").everyTime(1000,function(i){
            j.ajax({
              url: "refresh.php",
              cache: false,
              success: function(html){
                j(".refresh").html(html);
              }
            })
        })
    
    });
    

    Late answer. Hope this will help users researching on similar functions.

提交回复
热议问题