On page load, I do an ajax call to populate a <select>
-element. The options of the <select>
-element are stored in a database.
This works fine, but I'm getting different behaviors in different browsers, due to bfcache
, when going back to the page using the back button:
In safari, it works as expected: after clicking the back button, the option I selected is still selected. This is because safari remembered my state and didn't do the ajax call again.
In chrome, however, this option I selected isn't selected. That's because Chrome does the ajax call again. While it has the possibility to remember the selected option in forms, it can't do that in my case because the ajax call is executed again.
Anyone has a possible solution for this? Is there a way to make Chrome behave like safari, so that it doesn't execute all the javascript again?