HTML5 / JS storage event handler

让人想犯罪 __ 提交于 2019-11-30 10:10:47
jmease

Storage event handlers only fire if the storage event is triggered from another window.

How can I get an event to fire every time localStorage is updated in Safari 5+?

Could you provide some more code for how you are storing the keys? It works for me on Safari - http://jsfiddle.net/pvRgH/

the 'storage' event occurred by the other tab in the browser. When you change the storage in one page and addEventLister also in this page , the window can not catch the message.

for example

You have two page, pageOne change the storage , pageTwo will catch the 'storage' message and handle this, but pageOne couldn't catch the message.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!