PageTransitionEvent
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2015年7月.
PageTransitionEvent イベントオブジェクトは、文書が読み込まれるか、または終了する際に発行される pageshow および pagehide イベントのハンドラー内で使用できます。
コンストラクター
PageTransitionEvent()-
新しい
PageTransitionEventオブジェクトを生成します。
インスタンスプロパティ
このインターフェイスには、親である Event から継承したプロパティもあります。
PageTransitionEvent.persisted読取専用-
キャッシュから読み込んでいる文書であるかどうかを示します。
例
>HTML
html
<!doctype html>
<html lang="ja">
<body></body>
</html>
JavaScript
js
window.addEventListener("pageshow", (event) => {
if (event.persisted) {
alert("このページはブラウザーがキャッシュしたものです");
} else {
alert("このページはブラウザーがキャッシュしたものではありません");
}
});
仕様書
| Specification |
|---|
| HTML> # the-pagetransitionevent-interface> |
ブラウザーの互換性
Loading…