Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

WindowEventHandlers.onstorage

这篇翻译不完整。请帮忙从英语翻译这篇文章

WindowEventHandlers.onstorage 属性包含一个在storage事件触发时的事件句柄。 当存储域发生改变时会触发事件。(例如: 有新的项被存储)

语法

windowObj.onstorage = function() { ... };

用例

window.onstorage = function(e) {
  console.log( e.key + ' 键已经从 ' + e.oldValue + ' 改变为 ' + e.newValue + '.');
};

说明书

Specification Status Comment
WHATWG HTML Living Standard
onstorage
Living Standard  

浏览器兼容性

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support ? 45 (45) ? ? ?
Feature Android Android Webview Firefox Mobile (Gecko) Firefox OS IE Mobile Opera Mobile Safari Mobile Chrome for Android
Basic support ? ? 45.0 (45) ? ? ? ? ?

文档标签和贡献者

 此页面的贡献者: lynnic26
 最后编辑者: lynnic26,