Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

localStorage is not defined

if (typeof window !== 'undefined') {
    localStorage.setItem('myCat', 'Tom');
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #localStorage #defined
ADD COMMENT
Topic
Name
3+2 =