Home Top Ad

Hide div refresh while using setInterval

Share:

Hide div refresh while using setInterval

flickering happen because you update the content before the ajax call completes not after it
you can try this
var append_increment = 0;
    setInterval(function() {
        $.ajax({
            type: "GET",
            url: "{% url 'tables' %}",
            data: {' tables ': append_increment}
        })
        .done(function(response) {
            $('#_change tr').empty().$('#_change tr').html(response).fadeIn(500, "linear");

            append_increment += 0;
        });
    }, 5000)
  1. or let the html response from server be without
    .done(function(response) {
        $('#_change').html(response)
    
        append_increment += 0;
    });

Aucun commentaire