-
-
Save VandeurenGlenn/1e7dd2ee08a6c3a4a8b7 to your computer and use it in GitHub Desktop.
Example of listening to local storage changes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (window.addEventListener) { | |
window.addEventListener("storage", onStorage, false); | |
} else { | |
window.attachEvent("onstorage", onStorage); | |
}; | |
var onStorage = function(data) { | |
// Receive changes in the localStorage | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment