jQuery page transition and browser history

前端 未结 4 576
自闭症患者
自闭症患者 2020-12-09 22:34

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

4条回答
  •  独厮守ぢ
    2020-12-09 23:05

    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?

提交回复
热议问题