aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/window/offline_event/index.html
blob: 7b1886ceaa1b45f0d1d2500aa5e3b6ce85faae64 (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
---
title: offline
slug: Web/API/Window/offline_event
translation_of: Web/API/Window/offline_event
---
<p>当浏览器失去网络连接时,<code>offline</code>事件被触发。并且<code>navigator.onLine</code>的值变为 <code>false</code></p>

<h2 id="常规信息">常规信息</h2>

<dl>
 <dt>规范</dt>
 <dd><a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/offline.html#event-offline" rel="noopener">HTML5 Offline</a></dd>
 <dt>接口</dt>
 <dd>Event</dd>
 <dt>是否冒泡</dt>
 <dd></dd>
 <dt>可取消默认行为</dt>
 <dd></dd>
 <dt>目标对象</dt>
 <dd>当前网页(<code>&lt;window&gt;</code>)</dd>
 <dt>默认行为</dt>
 <dd></dd>
</dl>

<h2 id="属性">属性</h2>

<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">属性</th>
   <th scope="col">类型</th>
   <th scope="col">描述</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td><code>target</code> {{readonlyInline}}</td>
   <td>{{domxref("EventTarget")}}</td>
   <td>产生该事件的对象(DOM树中最顶级的那个对象).</td>
  </tr>
  <tr>
   <td><code>type</code> {{readonlyInline}}</td>
   <td>{{domxref("DOMString")}}</td>
   <td>事件类型.</td>
  </tr>
  <tr>
   <td><code>bubbles</code> {{readonlyInline}}</td>
   <td>{{jsxref("Boolean")}}</td>
   <td>该事件是否冒泡.</td>
  </tr>
  <tr>
   <td><code>cancelable</code> {{readonlyInline}}</td>
   <td>{{jsxref("Boolean")}}</td>
   <td>该事件是否可取消默认行为.</td>
  </tr>
 </tbody>
</table>

<h2 id="相关事件">相关事件</h2>

<ul>
 <li><a href="/en-US/docs/Mozilla_event_reference/online"><code>online</code></a></li>
</ul>