aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/pagetransitionevent/persisted/index.html
blob: 831eb7bbf70b4b7ce98855388e996a28a212ebf4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
---
title: PageTransitionEvent.persisted
slug: Web/API/PageTransitionEvent/persisted
translation_of: Web/API/PageTransitionEvent/persisted
---
<div>{{APIRef("HTML DOM")}}</div>

<p>只读属性<code><strong>persisted</strong></code>代表一个页面是否从缓存中加载的</p>

<h2 id="Syntax">Syntax</h2>

<pre class="brush: js notranslate">window.addEventListener('pageshow', function(event) {
  if (event.persisted) {
    console.log('Page was loaded from cache.');
  }
});</pre>

<h3 id="Value">Value</h3>

<p>A {{jsxref("Boolean")}}.</p>

<h2 id="Specifications">Specifications</h2>

<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>{{SpecName('HTML WHATWG', '#dom-pagetransitionevent-persisted', 'PageTransitionEvent: persisted')}}</td>
   <td>{{Spec2('HTML WHATWG')}}</td>
   <td>Initial definition</td>
  </tr>
 </tbody>
</table>

<h2 id="Browser_compatibility">Browser compatibility</h2>



<p>{{Compat("api.PageTransitionEvent.persisted")}}</p>