It\'s there a way to configure the setInterval method of javascript to execute the method immediately and then executes with the timer
setInterval
To solve this problem , I run the function a first time after the page has loaded.
function foo(){ ... } window.onload = function() { foo(); }; window.setInterval(function() { foo(); }, 5000);