Nos bénévoles n'ont pas encore traduit cet article en Français. Inscrivez-vous et aidez-nous à réaliser cette tâche !
Vous pouvez également lire cet article en English (US).

The onstorage property of the WindowEventHandlers mixin is the EventHandler for processing storage events. These events fire when a storage area is changed (e.g., a new item is stored.)

Syntax

 window.onstorage = function(event) { ... };

Example

This example logs the value for a key whenever it changes.

window.onstorage = function(e) {
  console.log('The ' + e.key +
    ' key has been changed from ' + e.oldValue +
    ' to ' + e.newValue + '.');
};

Specifications

Specification Status Comment
HTML Living Standard
The definition of 'onstorage' in that specification.
Living Standard  

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
Basic supportChrome ? Edge Full support YesFirefox Full support 45IE ? Opera ? Safari ? WebView Android No support NoChrome Android No support NoEdge Mobile Full support YesFirefox Android Full support 45Opera Android ? Safari iOS ? Samsung Internet Android ?

Legend

Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown

Étiquettes et contributeurs liés au document

Contributeurs à cette page : mfluehr, sideshowbarker, fscholz, erikadoyle, teoli, chrisdavidmills
Dernière mise à jour par : mfluehr,