May 3, 2012
jquery load between two urls
Question by Mr. 1.0
I am trying to load content from 2 different URLS but at different intervals. Ideally I would like to load one url wait 10 seconds load the other and repeat the over and over. This is what I have but its not working correctly. Its constantly loading the urls rapidly back and forth so fast I cant read the content
setInterval(function(){
$('#ticker').load('misc.php?users=10');
}, 10000);
setInterval(function(){
$('#ticker').load('misc.php?news=10');
}, 20000);