web api interface
PageTransitionEvent
The PageTransitionEvent event object is available inside handler functions for the pageshow and pagehide events, fired when a document is being loaded or unloaded.
Constructor
PageTransitionEvent()- : Creates a new
PageTransitionEventobject.
- : Creates a new
Instance properties
This interface also inherits properties from its parent, Event.
persistedRead only- : Indicates if the document is loading from a cache.
Example
window.addEventListener("pageshow", (event) => {
if (event.persisted) {
alert("The page was cached by the browser");
} else {
alert("The page was NOT cached by the browser");
}
});
Specifications
SpecificationsStandards references are available on the canonical MDN page.
Browser compatibility
Browser compatibilityCompatibility data is available on the canonical MDN page.