Saving DOM changes after clicking a link and then clicking the back button

I am using jQuery's appendTo () method to add items to an unordered list. When a user clicks on another link and then clicks the back button, the added items disappear. Is there a way to save these changes using JavaScript?

+5
source share
3 answers

As soon as the user navigates from your page, the DOM will be dropped. When your user clicks the back button, they get a new copy of HTML from your server (or from their cache).

So, you have one of two options:

  • - DOM cookie ( ), , cookie , , .

  • , , . , cookie , click , , , DOM var theDOM = $('html').clone(true);, HTML AJAX.

, . API API HTML5. - - URL- ( IE ). , "", DOM ...

, . , . ?

+2

BACK ( ) . , - "no-store, no-cache, must-revalidate", BACK.

Chrome "", IE . ( w3c) .

+3

iframe, . iframe load event js-, . , , iframe , ,

+1

All Articles