Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

localstorage try catch

try {
  localStorage.setItem(key, value);
} catch(e) {
  if (e.code == 22) {
    // Storage full, maybe notify user or do some clean-up
  }
}
 
PREVIOUS NEXT
Tagged: #localstorage #catch
ADD COMMENT
Topic
Name
5+6 =