aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/window/storage_event/index.html
blob: 7a9c4716369c758f9b68c715c36a2ecbd4576ada (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
86
87
88
89
90
91
92
93
---
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>

<p>说明: <em><a class="external" href="http://www.w3.org/TR/webstorage/#the-storage-event">Web Storage</a></em></p>

<table class="properties">
  <tbody>
    <tr>
      <th scope="row">接口</th>
      <td>{{domxref("StorageEvent")}}</td>
    </tr>
    <tr>
      <th scope="row">是否冒泡</th>
      <td>No</td>
    </tr>
    <tr>
      <th scope="row">目标</th>
      <td>DefaultView (<code>&lt;window&gt;</code>)</td>
    </tr>
    <tr>
      <th scope="row">默认行为</th>
      <td></td>
    </tr>
  </tbody>
</table>

<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>