I’m working with jQuery to have a fade-in effect on my html page, which works just fine. However, when I hit the back-button in my browser, I go to the right url but get a blank page. Is this a browser-caching thing? I’m relatively new to jQuery and I’m not really sure how to solve this.
This is the site: http://www.e-preview.be/huyzewaterloos/nl/index.html
The code I’m using is this:
//page transition
$("body").css("display", "none");
$("body").fadeIn(1500);
$("a.transition").click(function(event){
event.preventDefault();
linkLocation = this.href;
$("body").fadeOut(500, redirectPage);
});
function redirectPage() {
window.location = linkLocation;
}
It’s because you page is in “bfcache” (see a Firefox article). For disable bfcache, you can just add an onunload attribut:
Source : Ajax, back button and DOM updates and Is there a cross-browser onload event when clicking the back button?