Hi, i use jquery and this function: var news = setInterval(function() { $('#news).load(news2.php?id='+ Math.random()); }, 5000);
But this function re-enter div. I want to add a div, that old data remains.
daveVk
1:04 pm on Aug 31, 2009 (gmt 0)
Put the news div within a newContianer div ( not part of load ), change #news to #newContianer.
MarrkoR
3:17 pm on Aug 31, 2009 (gmt 0)
Yes, but when refresh script after 5s. all data delete
daveVk
12:00 am on Sep 1, 2009 (gmt 0)
I thought you where replacing news article with another each 5 secs ? Please explain what you would like to happen and what currently happens in a bit more detail, I do not understand problem.
whoisgregg
7:28 pm on Sep 2, 2009 (gmt 0)
If you want to simply append the new items to the old items, don't use .load() on the jQuery AJAX object. Instead, use .get() and define a callback function that uses .append() to add the returned content to the #news div.