Skip to content Skip to sidebar Skip to footer

Jquery Auto Refresh Every Minute Based On Current Rest Second Time And Based On Pc Time Updating

Continuing this question I have JS function to refresh by ajax every 60 seconds. var fetchData = function() { $.ajax( { url: 'chkProfile.php', type: 'POST'

Solution 1:

Try this approach:

var fetchData  = function(){
    $.ajax({
        url: "chkProfile.php",
        type: "POST",
        data:
        {
        },
        dataType: "JSON",
        success: function (jsonStr)
        {
        }
    });
}

fetchData();

setInterval(function(){
   var second = parseInt((new Date().getTime() / 1000) % 60);
    if(second === 0) {
       fetchData();
      }
},1000);

Post a Comment for "Jquery Auto Refresh Every Minute Based On Current Rest Second Time And Based On Pc Time Updating"