x
 
<!DOCTYPE html>
<html>
<body onpageshow="myFunction(event)">
<h1>Hello World!</h1>
<p><b>注释:</b>Internet Explorer 10 及更早版本不支持 onpageshow 事件。</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>
</html>