Web Storage API
The StorageEvent() constructor creates a new StorageEvent object.
Syntax
new StorageEvent(type)
new StorageEvent(type, options)
Parameters
type- : A string with the name of the type of the
StorageEvent. It is case-sensitive and browsers set it tostorage.
- : A string with the name of the type of the
options- : An object that, in addition of the properties defined in Event/Event, has the following properties:
key- : A string that represents the key for the storage item that changed. Defaults to
null.
- : A string that represents the key for the storage item that changed. Defaults to
oldValue- : A string containing the original value of the storage item. Defaults to
null.
- : A string containing the original value of the storage item. Defaults to
newValue- : A string with the new value of the
key. Defaults tonull.
- : A string with the new value of the
url- : A string with the URL of the document whose storage changed.
storageArea- : A Storage object that represents the storage that was affected. Defaults to
null.
- : A Storage object that represents the storage that was affected. Defaults to
- : An object that, in addition of the properties defined in Event/Event, has the following properties:
Return value
A new StorageEvent object.
Specifications
Browser compatibility
See also
- Web Storage API
来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。
