EN
이 콘텐츠는 한국어로 제공되지 않아 영어 버전으로 표시됩니다.

StorageEvent object

Provides event properties that are specific to the onstorage event.

HTML5 A vocabulary and associated APIs for HTML and XHTML, Section 5.11.1.5Internet Explorer 9

 

DOM Information

Inheritance Hierarchy

 Event
   StorageEvent

Members

The StorageEvent object has these types of members:

Methods

The StorageEvent object has these methods.

MethodDescription
initEvent

Initializes a new generic event that the createEvent method created.

initStorageEvent

Initializes a new DOM storage event that the createEvent method created.

preventDefault

Cancels the default action of an event.

stopImmediatePropagation

Prevents any further propagation of an event.

stopPropagation

Prevents propagation of an event beyond the current target.

 

Properties

The StorageEvent object has these properties.

PropertyDescription

bubbles

Gets a value that indicates whether an event propagates up from the event target.

cancelable

Gets a value that indicates whether you can cancel an event's default action.

cancelBubble

Gets or sets a value that indicates whether an event should be stopped from propagating up from the current target.

currentTarget

Gets the event target that is currently being processed.

defaultPrevented

Gets a value that indicates whether the default action should be canceled.

eventPhase

Gets the event phase that is being evaluated.

isTrusted

Gets a value that indicates whether a trusted event source created an event.

key

Gets the key that is updated.

newValue

Gets the new value of the key.

oldValue

Gets the previous value of the key.

srcElement

Gets the element that the event was originally dispatched to. Compare to target.

storageArea

Gets the Storage object of the affected document.

target

Gets the element that is the target of the event.

timeStamp

Gets the time, in milliseconds, when an event occurred.

type

Gets the name of an event.

url

Gets the address of the document that the update affects.

 

Standards information

Examples

The following code example demonstrates how to respond to storage events.


function reportStorage(evt) {
    alert("Storage was updated for " + evt.url);
}
window.onload = function() {
    window.addEventListener('storage',reportStorage,false);
    window.sessionStorage.setItem('key','value');
} 

See also

Reference
onstorage
localStorage
sessionStorage

 

 

표시:
© 2014 Microsoft