blob: ccd6816faf6007cfc8ab1beb43d9f07f601b650a (
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
---
title: PerformanceNavigation
slug: Web/API/PerformanceNavigation
translation_of: Web/API/PerformanceNavigation
---
<p>{{APIRef("Navigation Timing")}}</p>
<h2 id="Summary">Summary</h2>
<p><strong><code>PerformanceNavigation</code></strong><code>接口呈现了如何导航到当前文档的信息。</code></p>
<p>这个类型的对象可以被只读属性{{domxref("Performance.navigation")}}调用。</p>
<h2 id="Properties">Properties</h2>
<p><em><code>PerformanceNavigation</code> 接口不继承任何属性。</em></p>
<dl>
<dt>{{domxref("PerformanceNavigation.type")}} {{readonlyInline}}</dt>
<dd>一个无符号短整型,表示是如何导航到这个页面的。可能的值如下:
<dl>
<dt><code>TYPE_NAVIGATE</code> (0)</dt>
<dd>当前页面是通过点击链接,书签和表单提交,或者脚本操作,或者在url中直接输入地址,type值为0</dd>
<dt><code>TYPE_RELOAD</code> (1)</dt>
<dd>点击刷新页面按钮或者通过{{domxref("Location.reload()")}}方法显示的页面,type值为1</dd>
<dd>The page was accessed by clicking the Reload button or via the {{domxref("Location.reload()")}} method.</dd>
<dt><code>TYPE_BACK_FORWARD</code> (2)</dt>
<dd>页面通过历史记录和前进后退访问时。type值为2</dd>
<dt><code>TYPE_RESERVED</code> (255)</dt>
<dd>任何其他方式,type值为255</dd>
</dl>
</dd>
<dt>{{domxref("PerformanceNavigation.redirectCount")}} {{readonlyInline}}</dt>
<dd>无符号短整型,表示在到达这个页面之前重定向了多少次。</dd>
</dl>
<h2 id="Methods">Methods</h2>
<p><em><em><code>Performance</code> 接口没有继承任何方法</em></em></p>
<dl>
<dt>{{domxref("PerformanceNavigation.toJSON()")}} {{non-standard_inline}}</dt>
<dd>把<code>PerformanceNavigation</code>转换成JSON对象</dd>
</dl>
<h2 id="Specifications">Specifications</h2>
<table class="standard-table">
<tbody>
<tr>
<th scope="col">Specification</th>
<th scope="col">Status</th>
<th scope="col">Comment</th>
</tr>
<tr>
<td>{{SpecName('Navigation Timing', '#sec-navigation-info-interface', 'PerformanceNavigation')}}</td>
<td>{{Spec2('Navigation Timing')}}</td>
<td>Initial definition.</td>
</tr>
</tbody>
</table>
<h2 id="Browser_compatibility">Browser compatibility</h2>
<div>
<p>{{Compat("api.PerformanceNavigation")}}</p>
</div>
<h2 id="See_also">See also</h2>
<ul>
<li>The {{domxref("Performance")}} that allows access to an object of this type.</li>
<li>{{domxref("PerformanceNavigationTiming")}} (part of Navigation Timing Level 2) {{experimental_inline}}</li>
</ul>
|