Is it possible to call a function with SetInterval()
on specific time but execute the function only once.
function get_feed(social) {
$.ajax({})
}
setInterval(function(){
get_feed('facebook');
},5000);
setInterval(function(){
get_feed('twitter');
},10000);
I am expecting result to be called only once on the specify time:
on 5000ms: get_feed('facebook');
on 10000ms: get_feed('twitter');
but currently its calling two functions on 10000ms;