what will persist when returning via back button?

后端 未结 4 998
盖世英雄少女心
盖世英雄少女心 2021-01-02 00:49

I understand that a checkbox will remain checked when you return to a page via the back button. Classes added using jquery\'s addClass however do not. Can someone help me

4条回答
  •  不知归路
    2021-01-02 01:28

    Modern browsers try to persist more and more. Firefox experimented several years ago with preserving everything including class name changes, as long as the server indicates that the page is cachable in the HTTP header and the webpage has not registered any onunload event handlers. Firefox fires onpageshow and onpagehide when the user presses back.

    https://developer.mozilla.org/en-US/docs/Using_Firefox_1.5_caching https://www.webkit.org/blog/516/webkit-page-cache-ii-the-unload-event/

提交回复
热议问题