Browser “Back” Button vs. jQuery-animated page

后端 未结 3 939
攒了一身酷
攒了一身酷 2020-12-15 23:42

I have a challenging problem I\'ve been battling for some time now.

The Problem: when I go back to previous page using browser\'s back button, the page is d

3条回答
  •  一向
    一向 (楼主)
    2020-12-16 00:07

    Check out this thread. He suggests a hack as given below (copied from there):

    The onload event should be fired when the user hits the back button. Elements not created via JavaScript will retain their values. I suggest keeping a backup of the data used in dynamically created element within an INPUT TYPE="hidden" or TEXTAREA set to display:none then onload using the value of the textbox to rebuild the dynamic elements to the way they were.

    If you don't care about rebuilding the page and want to actually reload it, then you could do: Code:

    
    
    

    you can make the hidden value as "Yes" on #menu click.

    HTH

提交回复
热议问题