jquery - Refreshing multiple Divs on same page -
lets have 3 divs on page.
<div id='1'></div> <div id='2'></div> <div id='3'></div>
currently i'm using fresh div:
auto_refresh = false; if (auto_refresh === false) { auto_refresh = setinterval(function (){$('#1').load(thisurl + '&timer=' + new date().gettime() + ' #1' );}, 5000); } else { clearinterval(auto_refresh); auto_refresh = false; }
and want refresh div 1 , 2 every 5 seconds, not div 3. how can using jquery? thing add is, id's of divs dynamic.
like people have mentioned, want use setinterval
. 1 way refresh not all, use class
selector, rather id
. if must use ids, need use rule exclude third div.
i put refresh logic function, , call function inside of setinterval.
Comments
Post a Comment