StorageEvent: initStorageEvent() 方法

已弃用:此特性不再推荐。虽然某些浏览器可能仍然支持它,但它可能已经从相关的网络标准中删除,可能正在删除过程中,或者可能仅为兼容性目的而保留。请避免使用它,如果可能,请更新现有代码;请参阅本页底部的兼容性表格以指导您的决策。请注意,此特性可能随时停止工作。

StorageEvent.initStorageEvent() 方法用于初始化 StorageEvent 的值。

语法

js
initStorageEvent(type)
initStorageEvent(type, canBubble)
initStorageEvent(type, canBubble, cancelable)
initStorageEvent(type, canBubble, cancelable, key)
initStorageEvent(type, canBubble, cancelable, key, oldValue)
initStorageEvent(type, canBubble, cancelable, key, oldValue, newValue)
initStorageEvent(type, canBubble, cancelable, key, oldValue, newValue, url)
initStorageEvent(type, canBubble, cancelable, key, oldValue, newValue, url, storageArea)

参数

typeArg

事件的名称。

canBubble 可选

一个布尔值,指示事件是否会在 DOM 中冒泡。

cancelable 可选

一个布尔值,指示事件是否可取消。

key 可选

由于此事件而正在更改的键。

oldValue 可选

键的旧值。

newValue 可选

键的新值。

url 可选

发起更改的文档的 URL。

storageArea 可选

表示事件发生的存储区域的 Storage 对象。

返回值

无(undefined)。

规范

规范
HTML
# dom-storageevent-initstorageevent

浏览器兼容性

另见