Call a javascript function at distinct time intervals

Posted by Dkong on Stack Overflow See other posts from Stack Overflow or by Dkong
Published on 2010-04-22T14:57:31Z Indexed on 2010/04/22 15:03 UTC
Read the original article Hit count: 220

Filed under:

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);
}

© Stack Overflow or respective owner

Related posts about JavaScript