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

瀏覽器相容性

另見