PageTransitionEvent:PageTransitionEvent() 构造函数
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2020年1月.
PageTransitionEvent() 构造函数创建一个新 PageTransitionEvent 对象,用于(在页面加载或卸载时在 window 对象上触发的)pageshow 或 pagehide 事件。
语法
js
new PageTransitionEvent(type, options)
参数
type-
一个表示事件名称的字符串。其大小写敏感,且浏览器通常将其设置为
pageshow或pagehide。 options可选-
一个对象,除在
Event()定义的属性外,还具有以下属性:persisted可选-
一个表明文档是否由缓存加载的布尔值。
返回值
一个新的 PageTransitionEvent 对象。
规范
| Specification |
|---|
| HTML> # the-pagetransitionevent-interface> |