I have a problem with Local Storage for To Do List - Can any one help me ? | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
+ 2

I have a problem with Local Storage for To Do List - Can any one help me ?

Hi, i searched about my problem but i didn't found an answer for it. I have learned how to create a to do list but i want to use local storage, i tried to do it when i use loacalStorage.setItem('key', 'value') and get the value with ~~.getItem('key') for example. Can any one help me please to solve it ? this is the code sorry i'm asking from web version sololearn https://code.sololearn.com/WW7XjfbRKZ7q/#html

31st Jul 2018, 9:20 AM
Abdelrahman Ashref
Abdelrahman Ashref - avatar
6 Respuestas
+ 4
Abdelrahman Ashref You can find it here https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage Basically only 4 functions The syntax for setting the localStorage item is as localStorage.setItem('myCat', 'Tom'); The syntax for reading the localStorage item is as follows: var cat = localStorage.getItem('myCat'); The syntax for removing the localStorage item is as follows: localStorage.removeItem('myCat'); The syntax for removing all the localStorage items is as follows: localStorage.clear();
31st Jul 2018, 12:48 PM
Calviղ
Calviղ - avatar
+ 9
Not sure if this will help but if you would like to look at an example you could check out my Recipe Box which uses local storage. See https://code.sololearn.com/W930yAQ9H12Q/#html.
31st Jul 2018, 9:52 AM
Richard Myatt
Richard Myatt - avatar
+ 4
localstorage cannot run on Code Playground
31st Jul 2018, 9:37 AM
Calviղ
Calviղ - avatar
+ 1
Richard Myatt , I seen it but i'm not working with Vue.js i'm working with Jquery and Angular JS however this is exactly what i'm looking for.
31st Jul 2018, 12:39 PM
Abdelrahman Ashref
Abdelrahman Ashref - avatar
+ 1
Calviղ , Thanks a lot sir. I will practice it now.
31st Jul 2018, 12:53 PM
Abdelrahman Ashref
Abdelrahman Ashref - avatar
0
Calviղ , I got it. Do you have any link that explain local storage because i have visited W3C and nothing their.
31st Jul 2018, 12:36 PM
Abdelrahman Ashref
Abdelrahman Ashref - avatar