Rofi Fathurrohman Rofi Fathurrohman - 1 year ago 125
Ajax Question

Ajax Load file without blinking

i'm developing a web page, inside there are auto load data, the script I took in tutorial website, but its weakness, text always blink every few seconds, if it can be made so as not to be blinking? I'm beginner for Ajax, and it makes me confused.

Here's code:

function loadValue5() {
$.ajax({
method: 'GET',
url: 'grab_count_old.php',
success: function(responseText) {
$('#amt').fadeOut('fast', function () {
$('#amt').val(responseText).fadeIn('fast', function() {
setTimeout(loadValue5, 100);
});
});
}
});
}
loadValue5();

Answer Source

remove the fade effects

function loadValue5() {
    $.ajax({
        method: 'GET',
        url: 'grab_count_old.php',
        success: function(responseText) {
                $('#amt').val(responseText);
                setTimeout(loadValue5, 100);
        }
    });
}
loadValue5();
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download