Tryit Editor v2.3

Edit This Code:
<!DOCTYPE html> <html> <body onpageshow="myFunction(event)"> <h1>Hello World!</h1> <p><strong>Note:</strong> The onpageshow event and the persisted property is not supported in Internet Explorer 10 and earlier versions.</p> <script> function myFunction(event) { if (event.persisted) { alert("The page was cached by the browser"); } else { alert("The page was NOT cached by the browser"); } } </script> </body> <!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_onpageshow_persisted by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 23 Jan 2015 08:29:38 GMT --> </html>
Result:
Try it Yourself - © w3schools.com