构造函数
PageTransitionEvent()-
创建一个新的
PageTransitionEvent对象。
实例属性
此接口还继承了其父级 Event 的属性。
PageTransitionEvent.persisted只读-
表示文档是否从缓存中加载。
示例
HTML
html
<!doctype html>
<html lang="en-US">
<body></body>
</html>
JavaScript
js
window.addEventListener("pageshow", (event) => {
if (event.persisted) {
alert("The page was cached by the browser");
} else {
alert("The page was NOT cached by the browser");
}
});
规范
| 规范 |
|---|
| HTML # the-pagetransitionevent-interface |
浏览器兼容性
加载中…