+ 1

How?

How use localStorage.setItem and localStrage.getItem with JS, because he added numbers and not chars

26th Dec 2017, 12:05 PM
Crinax
Crinax - avatar
1 Antwort
+ 1
if (typeof(Storage) === 'undefined') { /*browser does not support localstorage*/ } else { /* storage code goes here */ } localStorage.setItem(key, value); Sets a value to a key. localStorage.getItem(key); Returns a key's value localStorage.clear(); Clears the storage Local storage can only use strings. Convert your variables to string when setting them and convert them back when accessing
4th Jan 2018, 1:03 PM
Lil Taco
Lil Taco - avatar