Skip to content
Related Articles

Related Articles

HTML | DOM PageTransitionEvent

View Discussion
Improve Article
Save Article
  • Last Updated : 01 Feb, 2019

The PageTrasitionEvent occurs during the time a document is being loaded or unloaded.



Property Values:

  • persisted: Returns boolean value whether the webpage was cached or not.

Return Value: This property returns True if the document is loaded from a cache or not otherwise it returns False.


<!DOCTYPE html>
<body bgcolor="green" onpageshow="myFunction(event)">
        <h1 style="color:white;">GeeksforGeeks</h1>
        <p id="demo" style="color:white;"></p>
        function myFunction(event) {
            // Check page was cached by the browser
            // or not.
            if (event.persisted) {
                alert("Cached by Browser");
            } else {
                alert("NOT cached by Browser");


Supported Browsers:

  • Google Chrome
  • Firefox
  • Edge
  • Safari
  • Opera
    • My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!