PageTransitionEvent persisted Property

Example

Find out whether the page was cached by the browser:

function myFunction(event) {
  alert(event.persisted);
}
Try it Yourself »

Description

The persisted property returns a Boolean value that indicates if the webpage is loaded directly from the server, or if the page is cached, when an onpageshow or onpagehide event occurs.

This property is read-only.


Syntax

event.persisted

Technical Details

Return Value: A Boolean, indicating whether the webpage is loading from a cache.

Possible values:

  • true - The page is cached by the browser
  • false - The page is NOT cached by the browser

Related Pages

HTML DOM reference: The onpageshow Event


Browser Support

event.persisted is a DOM Level 3 (2004) feature.

It is fully supported in all modern browsers:

Chrome Edge Firefox Safari Opera IE
Yes Yes Yes Yes Yes 11


Copyright 1999-2023 by Refsnes Data. All Rights Reserved.