PageTransitionEvent
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
コンストラクター
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 |