我們的志工尚未將本文翻譯為 正體中文 (繁體) 版本。加入我們,幫忙翻譯!
您也可以閱讀本文的 English (US) 版本。

Page transition events fire when a webpage is being loaded or unloaded.

DOM Information

 

Inheritance Hierarchy

 Event
   PageTransitionEvent

Example

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

Read-only

Indicates if a webpage is loading from a cache.

 

文件標籤與貢獻者

 此頁面的貢獻者: Chandler0415, kscarfone, fscholz, teoli, rabimba
 最近更新: Chandler0415,