rails datatables refresh javascript

Heptagone H wrote in post #1093275:

jQuery ->
    sPaginationType: "full_numbers"
    bJQueryUI: true
    bProcessing: true
  setInterval('$("#comments_id").dataTable().fnDraw()', 1000);

Take a look at the documentation for setInterval():


Looking at the function signature:


code = The function that will be executed.

You have passed a string for this argument. You can't call a string.

Solution: Give setInterval a function as is expected:

In JavaScript it should look something like:
setInterval(function() {
}, 1000);