Javascript examples for DOM Event:onpageshow
Find out whether the page was cached by the browser:
<!DOCTYPE html> <html> <body onpageshow="myFunction(event)"> <h1>Hello World!</h1> <script> function myFunction(event) {/*from w ww.j a v a 2 s .c om*/ 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>