Name
StorageEvent
Inherits from
Event
Synopsis
The localStorage and
sessionStorage
properties of a Window object refer to Storage objects that represent client-side storage
areas (see localStorage and sessionStorage). If more than one window,
tab, or frame is displaying documents from the same origin, multiple
windows have access to the same storage areas. If a script in one
window changes the contents of a storage area, a storage event is
triggered on all other Window objects that share access to that
storage area. (Note that the event is not triggered in the window
that made the change.) Storage events are triggered on the Window
object and do not bubble. They do not have any default action that
can be canceled. The object associated with a storage event is a
StorageEvent object, and its properties describe the change that
occurred to the storage area.
Properties
readonly stringkeyThis property is the key that was set or deleted. If the entire storage area was cleared with
Storage.clear(), this property (as well asnewValueandoldValue) will benull.readonly anynewValueThe new value of the specified
key. This will benullif the key was removed. At the time of this writing, browser implementations only allow string values to be stored.readonly anyoldValueThe old value of the key that was changed, or
nullif this key was newly added to the storage area. At the time of this writing browser implementations only allow string values to be stored.readonly StoragestorageAreaThis property ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access