<html>
<body onpageshow="myFunction(event)">
<h1>Hello World!</h1>
<p><strong>注意:</strong> Internet Explorer 10 及更早版本不支持 onpageshow 事件和持久化属性。</p>
<script>
function myFunction(event) {
if (event.persisted) {
alert("该页面已被浏览器缓存");
} else {
alert("该页面未被浏览器缓存");
}
}
</script>
</body>
</html>