WindowEventHandlers.onstorage
A propriedade WindowEventHandlers.onstorage
contém um manipulador de eventos que executa quando o evento storage (en-US)
dispara. Isto ocorre quando a área de armazenamento é mudada. (ex. um novo item é armazenado.)
Sintaxe
windowObj.onstorage = function() { ... };
Exemplos
js
window.onstorage = function(e) {
console.log('The ' + e.key + ' key has been changed from ' + e.oldValue + ' to ' + e.newValue + '.');
};
Especificações
Especificação | Status | Comentário |
---|---|---|
HTML Living Standard The definition of 'onstorage' in that specification. |
Padrão em tempo real |
Compatibilidade com navegadores
BCD tables only load in the browser