storage

当存储区域(localStorage 或 sessionStorage)被修改时,将触发 storage 事件。查看 Web Storage API 来获取更多信息。

常规信息

说明:Web Storage

接口 StorageEvent
是否冒泡 No
目标 DefaultView (<window>)
默认行为

属性

Property Type Description
target 只读 EventTarget 事件目标 (DOM 树中的最大目标)
type 只读 DOMString 事件的类型
bubbles 只读 Boolean 事件通常是否会出现冒泡
cancelable 只读 Boolean 事件是否可取消
key 只读 DOMString (string) 键更改时
oldValue 只读 DOMString (string) 正在更改键的旧值
newValue 只读 DOMString (string) 正在更改键的新值
url 只读 DOMString (string) 键更改的文档的地址
storageArea 只读 Storage 受影响的存储对象

规范

Specification
HTML Standard
# event-storage
HTML Standard
# handler-window-onstorage