--- title: PageTransitionEvent.persisted slug: Web/API/PageTransitionEvent/persisted translation_of: Web/API/PageTransitionEvent/persisted ---
只读属性persisted
代表一个页面是否从缓存中加载的
window.addEventListener('pageshow', function(event) { if (event.persisted) { console.log('Page was loaded from cache.'); } });
A {{jsxref("Boolean")}}.
Specification | Status | Comment |
---|---|---|
{{SpecName('HTML WHATWG', '#dom-pagetransitionevent-persisted', 'PageTransitionEvent: persisted')}} | {{Spec2('HTML WHATWG')}} | Initial definition |
{{Compat("api.PageTransitionEvent.persisted")}}