PageTransitionEvent - Web API 接口参考 编辑
Page transition events fire when a webpage is being loaded or unloaded.
当网页在加载完成或卸载后会触发页面传输事件(Page transition events)。
DOM Information
Inheritance Hierarchy
Event PageTransitionEventExample
HTML
<!DOCTYPE html>
<html>
<body onpageshow="myFunction(event)">
</body>
</html>
JavaScript
function myFunction(event) {
if (event.persisted) {
alert("The page was cached by the browser");
} else {
alert("The page was NOT cached by the browser");
}
}
Members
The PageTransitionEvent object has these types of members:
Properties
The PageTransitionEvent object has these properties.
Property | Access type | Description |
---|---|---|
persisted | 只读 | 标记页面是否从缓存(Backforward Cache)中加载 |
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论