Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make the bfcache in Internet Explorer work like Firefox

I have kind of the opposite problem of the accepted answer to this question: Ajax, back button and DOM updates

There, most people wanted Firefox to fire "unload" event when coming Back to the page with the Back button.

We manipulate the divs that are shown/hidden (navigating a tree), and go off to another page. When you click "Back", Firefox uses its bfcache and shows the page as it was when you left (this is good). IE shows the page in its initial state (this is bad). We want IE to behave like firefox and use its bfcache, are there any tricks to make it do so?

(we are not using Jquery)

like image 378
rpilkey Avatar asked Oct 19 '11 17:10

rpilkey


1 Answers

I found a similar question:( Differences in Internet Explorer and Firefox when dynamically loading content then going forward and back ) The answer there is that you can trick IE's history mechanism into keeping the modified dom by using a lot of javascript to rewrite the document, or put the values you want to save into hidden input fields. Anything better?

like image 52
rpilkey Avatar answered Sep 30 '22 19:09

rpilkey