Javascript examples for DOM:PageTransitionEvent
The persisted property tells if the webpage is loaded directly from the server, or if the page is cached.
This property is read-only.
A Boolean, telling if the webpage is loading from a cache.
The following code shows how to find out whether the page was cached by the browser:
<!DOCTYPE html> <html> <body onpageshow="myFunction(event)"> <script> function myFunction(event) {/* w ww .j a v a 2 s . c o m*/ if (event.persisted) { console.log("The page was cached by the browser"); } else { console.log("The page was NOT cached by the browser"); } } </script> </body> </html>