Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

listen to localstorage changes

window.addEventListener('storage', () => {
  // When local storage changes, dump the list to
  // the console.
  console.log(JSON.parse(window.localStorage.getItem('sampleList')));
});
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #listen #localstorage
ADD COMMENT
Topic
Name
5+3 =