A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.mozilla.org/en-US/docs/Web/API/PageTransitionEvent below:

PageTransitionEvent - Web APIs | MDN

PageTransitionEvent

Baseline Widely available

The PageTransitionEvent event object is available inside handler functions for the pageshow and pagehide events, fired when a document is being loaded or unloaded.

Event PageTransitionEvent Constructor
PageTransitionEvent()

Creates a new PageTransitionEvent object.

Instance properties

This interface also inherits properties from its parent, Event.

PageTransitionEvent.persisted Read only

Indicates if the document is loading from a cache.

Example HTML
<!doctype html>
<html lang="en-US">
  <body></body>
</html>
JavaScript
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 Browser compatibility See also

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.3