ajax.reload() does not seem to work in my case

ajax.reload() does not seem to work in my case

alextangalextang Posts: 9Questions: 2Answers: 0

I have the following code. the alert() box was only displayed once, not every 10 seconds as set. Did I do something wrong?

Alex

$(function() {
var table = $("#datatable").dataTable({
"ajax": {
"url": "{{ url_for('api_get_scheduled_install_status') }}",
"dataSrc": function ( json ) {
alert('test');
return json;
}
}
} );

  setInterval( function () {
    table.ajax.reload(); 
  }, 10000 );

});

Replies

This discussion has been closed.