keep old content on a .load()-event error
Hi!
I want to refresh the contents of a div every 2 hours (I use jQ for presentation). but I need to keep the old content until the ajax-refresh was successful.
here's my code so far:
-
//refresh page
-
$(document).everyTime('120s', 'pagerefresh', reloadSlides, 0, true);
-
// function
-
function reloadSlides() {
-
$("#pres").load("index-1.php");
-
}
if I break my internet connection and jQuery reloads the content, the div gets cleared. I want to ensure that the old content remains in the div, even if there's an error with the connection.
any ideas?
thanks!