I've created a stock ticker function and need to call it every 2 minutes.
I've succeeded in doing this with the javascript setInterval
function, but the problem is on the first call it waits 2 minutes before calling the function, whereas I want the first load to be called right away.
function CallFunction() {
setInterval("GetFeed()", 2000);
}
function CallFunction() { GetFeed(); setInterval("GetFeed()", 2000); }
function CallFunction() {
GetFeed();
return setInterval(GetFeed, 2 * 60 * 1000);
}
var id = CallFunction();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With