aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/performancetiming/dominteractive/index.html
blob: 843db953f9d7a12ef9bd4cf393dd4353ccf61f86 (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
---
title: PerformanceTiming.domInteractive
slug: Web/API/PerformanceTiming/domInteractive
translation_of: Web/API/PerformanceTiming/domInteractive
---
<p>{{APIRef("Navigation Timing")}}</p>

<h2 id="概要">概要</h2>

<p><code><strong>PerformanceTiming</strong></code><strong><code>.domInteractive</code></strong> 是一个返回代表一个时刻的 <code>unsigned long long</code> 型只读属性,为在主文档的解析器结束工作,即 {{domxref("Document.readyState")}} 改变为 <code>'interactive'</code> 并且相当于 {{event("readystatechange")}} 事件被触发之时的 Unix毫秒时间戳。</p>

<p>这个属性被用于测量用户感受的加载网页的速度。然而,如果脚本被屏蔽发生,而不是被异步加载或者使用了自定义的 Web 字体,这里有一些警告可能会发生。在使用这个值作为网页加载用户体验的媒介时,请务必<a href="http://www.stevesouders.com/blog/2015/08/07/dominteractive-is-it-really/">检查一下你是否处于以上的情况</a></p>

<h2 id="语法">语法</h2>

<pre class="syntaxbox"><em>time</em> = <em>performanceTiming</em>.domInteractive;</pre>

<h2 id="标准">标准</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', '#dom-performancetiming-dominteractive', 'PerformanceTiming.domInteractive')}}</td>
   <td>{{Spec2('Navigation Timing')}}</td>
   <td>Initial definition.</td>
  </tr>
 </tbody>
</table>

<h2 id="浏览器兼容性">浏览器兼容性</h2>

<div>
<div>


<p>{{Compat("api.PerformanceTiming.domInteractive")}}</p>
</div>
</div>

<h2 id="参见">参见</h2>

<ul>
 <li>它属于 {{domxref("PerformanceTiming")}} 接口。</li>
 <li>文章 "<a href="http://www.stevesouders.com/blog/2015/08/07/dominteractive-is-it-really/">domInteractive: is it? really?</a>" 解释了什么时候你可以使用这个属性作为加载网页的用户体验的代理。</li>
</ul>