1234567891011121314151617181920212223242526272829 |
- <html>
- <head>
- <script>
- function pageShown(evt)
- {
- if (evt.persisted)
- alert("pageshow event handler called. The page was just restored from the Page Cache.");
- else
- alert("pageshow event handler called for the initial load. This is the same as the load event.");
- }
- function pageHidden(evt)
- {
- if (evt.persisted)
- alert("pagehide event handler called. The page was suspended and placed into the Page Cache.");
- else
- alert("pagehide event handler called for page destruction. This is the same as the unload event.");
- }
- window.addEventListener("pageshow", pageShown, false);
- window.addEventListener("pagehide", pageHidden, false);
- </script>
- <body>
- <a href="http://www.webkit.org/">Click for WebKit</a>
- </body>
- </html>
|