aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/window/storage_event/index.html
blob: 81d66d57bccbf71ac17bdf7bbdf92bd3167090ba (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
77
78
79
80
81
82
83
84
85
---
title: storage
slug: Web/API/Window/storage_event
tags:
  - Web Storage
  - 事件
translation_of: Web/API/Window/storage_event
---
<p>当存储区域(localStorage 或 sessionStorage)被修改时,将触发 storage 事件。查看 <a href="/en-US/docs/Web/API/Web_Storage_API">Web Storage API</a> 来获取更多信息。</p>

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

<dl>
 <dt style="float: left; text-align: right; width: 120px;">说明</dt>
 <dd style="margin: 0 0 0 120px;"><em><a class="external" href="http://www.w3.org/TR/webstorage/#the-storage-event">Web Storage</a></em></dd>
 <dt style="float: left; text-align: right; width: 120px;">接口</dt>
 <dd style="margin: 0 0 0 120px;">{{domxref("StorageEvent")}}</dd>
 <dt style="float: left; text-align: right; width: 120px;">是否冒泡</dt>
 <dd style="margin: 0 0 0 120px;">No</dd>
 <dt style="float: left; text-align: right; width: 120px;">默认行为可取消</dt>
 <dd style="margin: 0 0 0 120px;">No</dd>
 <dt style="float: left; text-align: right; width: 120px;">目标</dt>
 <dd style="margin: 0 0 0 120px;">DefaultView (<code>&lt;window&gt;</code>)</dd>
 <dt style="float: left; text-align: right; width: 120px;">默认行为</dt>
 <dd style="margin: 0 0 0 120px;"></dd>
</dl>

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

<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">Property</th>
   <th scope="col">Type</th>
   <th scope="col">Description</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>
  <tr>
   <td><code>key</code> {{readonlyInline}}</td>
   <td>{{domxref("DOMString")}} (string)</td>
   <td>键更改时</td>
  </tr>
  <tr>
   <td><code>oldValue</code> {{readonlyInline}}</td>
   <td>{{domxref("DOMString")}} (string)</td>
   <td>正在更改键的旧值</td>
  </tr>
  <tr>
   <td><code>newValue</code> {{readonlyInline}}</td>
   <td>{{domxref("DOMString")}} (string)</td>
   <td>正在更改键的新值</td>
  </tr>
  <tr>
   <td><code>url</code> {{readonlyInline}}</td>
   <td>{{domxref("DOMString")}} (string)</td>
   <td>键更改的文档的地址</td>
  </tr>
  <tr>
   <td><code>storageArea</code> {{readonlyInline}}</td>
   <td>{{domxref("Storage")}}</td>
   <td>受影响的存储对象</td>
  </tr>
 </tbody>
</table>