Наши волонтёры ещё не перевели данную статью на Русский. Присоединяйтесь к нам и помогите сделать эту работу!
Вы можете также прочитать эту статью на English (US).

The PageTransitionEvent is fired when a document is being loaded or unloaded.

Properties

This interface also inherits properties from its parent, Event.

PageTransitionEvent.persisted Read only
Indicates if the document is loading from a cache.

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");
  }
}

Specifications

Specification Status Comment
HTML Living Standard
The definition of 'PageTransitionEvent' in that specification.
Living Standard Initial definition

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
Basic supportChrome Full support YesEdge ? Firefox Full support YesIE ? Opera Full support YesSafari ? WebView Android Full support YesChrome Android Full support YesEdge Mobile ? Firefox Android Full support YesOpera Android Full support YesSafari iOS ? Samsung Internet Android ?
persistedChrome Full support YesEdge ? Firefox Full support YesIE ? Opera Full support YesSafari ? WebView Android Full support YesChrome Android Full support YesEdge Mobile ? Firefox Android Full support YesOpera Android Full support YesSafari iOS ? Samsung Internet Android ?

Legend

Full support  
Full support
Compatibility unknown  
Compatibility unknown

Метки документа и участники

Внесли вклад в эту страницу: mfluehr, connorshea, sideshowbarker, fscholz, Claas, Chandler0415, kscarfone, teoli, rabimba
Обновлялась последний раз: mfluehr,