PageTransitionEvent persisted attribute

Definition and Usage

When onpageshow Or onpagehide Event When an event occurs, the persisted attribute returns a boolean value indicating whether the web page is loaded directly from the server or the page is cached.

This property is read-only.

Example

Determine whether the page is cached by the browser:

function myFunction(event) { 
  alert(event.persisted);
}

Try It Yourself

Browser Support

The numbers in the table indicate the first browser version that fully supports this property.

Property Chrome IE Firefox Safari Opera
persisted Support 11.0 Support 5.0 Support

Syntax

event.persisted

Technical Details

Return Value:

Boolean value indicating whether the web page is loading from the cache.

Possible Values:

  • true - Page Cached by Browser
  • false - Page Not Cached by Browser

Related Pages

HTML DOM Reference Manual:onpageshow Event