>>Might depend on the browser. See: http://stackoverflow.com/questions/2638292/after-travelling-back-in-firefox-history-javascript-wont-run > >Thanks, I am not sure it is the same thing. In my case, this is not the javascript being disabled but the HTML that was added to the page which is not persisting in the cache. Basically, the cache stores the content of the page initially loaded. But, it does not consider the added HTML.
I see from other posts on this thread that the user may have added multiple content. In that case it seems to me that you would need to store the current html (or serialized DOM) when the user navigates away from the page and then restore it on return.
You could keep this in local or session storage or, for HTML5, use pushstate() (or replacestate()) and popstate()