Skip to content

Instantly share code, notes, and snippets.

@febrianrendak
Created February 1, 2016 10:08

Revisions

  1. febrianrendak created this gist Feb 1, 2016.
    12 changes: 12 additions & 0 deletions call_interval.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    (function worker() {
    $.ajax({
    url: 'ajax/test.html',
    success: function(data) {
    $('.result').html(data);
    },
    complete: function() {
    // Schedule the next request when the current one's complete
    setTimeout(worker, 5000);
    }
    });
    })();