FF1.5 Add PageShowPageHide event

xiaoxiao2021-03-14  184

FF 1.5 began using a high-speed cache mechanism similar to Opera, http: //developer.mozilla.org/en/docs/using_firefox_1.5_caching. In most cases, the page is completely cache (exceptions such as HTTPS, Cache-Control, and pages with unload) until the browser is closed. This makes it in response to BF (Back / Forward). But there is a situation, that is, when BF, the online event is no longer triggered, and the inline script is not executed.

When there is unload, it is not cache, and the understanding of this is: I can think that UNLOAD indicates special actions, such as status saving, and for a web app, unload usually represents the end of a session. In order to call the symmetry, there should be onload to trigger OnLoad during the next access, ie the high speed cache should not be used.

FF 1.5 provides two new Events for this, respectively, Pageshow and PageHide. These two events are useful, they can be used to restore the state of the page. The example of ff shows its use.

转载请注明原文地址:https://www.9cbs.com/read-129311.html

New Post(0)