Oh wow, you are awesome. I spent so much time trying to figure out why all my user input box data was erasing from localStorage after trying to add more data after a browser refresh. Thank you so much!
Thank you, i didnt knew that i could create an array directly from the set item, i had my array in a var and it was reseting each time i clicked on my button, i was suffering for 2 days as a beginner 😂 thank you a lot.
thank you thank you thank you.. i was trying to store data from quill rich text editor into my localstorage but i don't understand others' explanations... i knew how to set and get the data but it keeps getting overwritten. so, i was looking for ways for to get the data in array and yours worked great for my rich text editor
Hey! I have a question for you. I'm making a resume maker website. For entering the details like personal, education, work experience and skills, I have made seperate html pages for each. And for saving each Page's entries, I have made a "Save" Button at the bottom. I want that when we click on the button,an alert should appear " Your data is saved." The problem is I don't know how to save it and show all the data together in the result page. Please help.
Hi! Here's what I'm getting. You have multiple pages so you can hit next and have it do it's thing. Saving should be quite easy! Whenever you hit next or save, store it to the local storage in an object. Hope it helps! Otherwise, email me.
dude!!! thank you so much for taking your time and explaining how localStorage works when working with array!! i am a newbie learning how to code, so thanks a million!
One question, i have an array if objects stored in local storage. And the value if the properties within each object os gotten from an input How do i check to make sure that certain values thatvare already existing in previous objects can't exist in a new ine
Okay but what if you have a list in your DOM and you want to populate each li with EACH local storage VALUE. how would you do that? Getting the entire array is almost pretty much always insufficient. What if you need to populate and element with ONE value from the JSON array? Any advice?
You don't call your function save and view and you don't call click event on yout input. How all of this can work ? I don't get it. My browser is asking for calling function at least. old_data is not a function.
I know what it's like not to have your code work. But I can help. I called the save and view function in the HTML button onclick. As for your error, you may have mistyped something important. Try watching the video again and code along. Hopefully that helps.
the data is only saved if it was typed on one device and if you open up another computer with this same code the data is not there is there a way to fix this and have the data stored permanently if you went on another computer and the data you entered is still there? store the information globally instead locally
For sure. First of all. Local storage is meant to be saved locally on a singular device. To achieve what you're looking for. You would need to run your website on a server with a database. But that might be a stretch. So use firebase. Firebase is a free cloud database that allows you to save data and have it appear on multiple devices.
Hello man,thank you for the tutorial it helped me a lot for my final project,but can you please explain how do I remove an array from a key?They are marked with indexes 0,1,2,3 under the key Value, I do it with for() or something else?
Thanks , very helpful ! Nne of my object's keys has an array as a value. I tried to JSON.stingify the whole thing but the content inside the array was saved an empty array ! do you know maybe why this is happening ?
Could you please add a delete button for the delete the key and value in localStorage.getItem(); or localStorage.setItem()? I have a hard time to make a simple button for this one though.
Do you have an idea on large form data that will be stored to localstorage? Our clients are complaining that they lost their data without saving so my solution supposedly is by storing it to localstorage. But after reading the 5/10mb limit, i do not know anymore. Your thoughts will be highly appreciated. Thanks
For sure. Try using Firebase. I would imaging you're using Local Storage because data can be easily saved and retrieved. But since you're noticing data loss. It would be best to store data on Firebase. It's just as easy and could be accessed on multiple devices.
Thank You SOOOO Much Broo i am working on a project and was stucked at this point cuz my local storage is replacing array values now it is solved Thanks again I am getting really frustated .....
Hy, That's was awesome vidoes, I just wonder why you just saved an empty array to local storage than direct saving with the data from the input. maybe you just save push the data to the array then save it to local storage than saving it twice
Well. You would have to check if the new value matches anything in local storage. If so, remove the new data from the array and append everything else.
Nice video! I have one question. Is it possible to store an array of numbers in cookie? I am making an e-commerce website for my school project and I am currently building a shopping cart. My array contains item_IDs from the database and I want to do a for-loop to display each item with corresponding image, price and name retrieving from the database using sql and php.
Yes it is. I'll definitely make a tutorial on cookies. But here's a stack overflow page that could help. stackoverflow.com/questions/4470477/create-array-in-cookie-with-javascript
hey Man! can you make a video that "user can update the data inside localStorage"? example, the data in sign up form, you will update it. been trying it but the new user will be push to the user :3
Oh. So updating individual items in the array/object. That's cool. But do this on the backend. Always remember, whatever is saved to Local Storage can be manually edited by the user. So depending on what you're saving, this could be a bad idea. For ex: networked_username, email, password, etc
Does it do this for all your browsers? Or just one? If this occurs in just one browser, it may be a browser setting. If it occurs in all, do you get any errors in your console?
Oh wow, you are awesome. I spent so much time trying to figure out why all my user input box data was erasing from localStorage after trying to add more data after a browser refresh. Thank you so much!
Thank you SO MUCH!!! You were the only who explained so well and detailed how to do it and the why of each thing.
That's awesome. I'm super glad I could help.
i like the way you communicate towards viewers
That's awesome to hear! Thanks.
Thank you, i didnt knew that i could create an array directly from the set item, i had my array in a var and it was reseting each time i clicked on my button, i was suffering for 2 days as a beginner 😂
thank you a lot.
Hehehe. You're very welcome.
OMG! I've been struggling on how to update localstorage. Tysm !!
You[re very welcome!
Wow! Just realized you got to 1K! Keep growing man!
It's super crazy. Thanks you to.
@@MelvinAdekanye I did not see you mentioned me. THANKS A LOT! 😍
you deserve more subs! thx so much, man.
You're very welcome!
thank you thank you thank you.. i was trying to store data from quill rich text editor into my localstorage but i don't understand others' explanations... i knew how to set and get the data but it keeps getting overwritten. so, i was looking for ways for to get the data in array and yours worked great for my rich text editor
What A amazing video brother...thanks a lot..
You're very welcome!
thanks alot man, this is just what I needed.
Glad to hear it!
Thanks a lot you saved me from scolding by my teacher ❤️❤️❤️❤️ n keep smiling ..❤️❤️❤️❤️
Most welcome 😊
@@MelvinAdekanye 💕❤💕❤💕❤ stay blessed
thank you so much I was going crazy trying to figure it out
You are welcome!
Very nice explanation, thank you.
Perfect for my big project, thanks!
Great to hear!
thank you so muchh dude you helped me finish my projectt
You are welcome
Hey! I have a question for you. I'm making a resume maker website. For entering the details like personal, education, work experience and skills, I have made seperate html pages for each. And for saving each Page's entries, I have made a "Save" Button at the bottom. I want that when we click on the button,an alert should appear " Your data is saved." The problem is I don't know how to save it and show all the data together in the result page. Please help.
Hi! Here's what I'm getting. You have multiple pages so you can hit next and have it do it's thing. Saving should be quite easy! Whenever you hit next or save, store it to the local storage in an object. Hope it helps! Otherwise, email me.
Really helpful , Thanks 🤩
You’re very welcome 😊
dude!!! thank you so much for taking your time and explaining how localStorage works when working with array!! i am a newbie learning how to code, so thanks a million!
No problem. Glad you found it useful.
I know it is kinda off topic but do anybody know of a good site to stream newly released series online ?
@Luka Ezekiel Flixportal
@Jesse Kendrick thank you, I signed up and it seems like a nice service :D I really appreciate it!
@Luka Ezekiel No problem xD
Thank you, this is the best explanation i found
Glad to hear that!
amazing! you're brilliant
One question, i have an array if objects stored in local storage.
And the value if the properties within each object os gotten from an input
How do i check to make sure that certain values thatvare already existing in previous objects can't exist in a new ine
Great video ,thank you!
Okay but what if you have a list in your DOM and you want to populate each li with EACH local storage VALUE. how would you do that? Getting the entire array is almost pretty much always insufficient. What if you need to populate and element with ONE value from the JSON array? Any advice?
I can help ---->
/*
Don't forget to add
*/
function addDataToList()
{
var arr = [];
arr = JSON.parse(localStorage.getItem('data'));
document.getElementById("output").innerHTML=arr;
for (const element of arr) {
console.log(element);
let listo = document.createElement("li");
listo.value = element;
listo.innerHTML = element;
document.getElementById("uls").appendChild(listo);
}
}
addDataToList();
Thank you, u solved me a big trouble
Greate video. Ive a issue though. If I want my view list vertically showed rather than inline. how do I fix that issue? thanks in advance
Thank you. Do you mean the CSS? Or the console?
very useful and understandable. I appreciate your work..
Glad it was helpful!
If I saw a comment that says "get data from input box" in a PR, your future with the team would be in question.
Hahaha.
You don't call your function save and view and you don't call click event on yout input. How all of this can work ? I don't get it. My browser is asking for calling function at least. old_data is not a function.
I know what it's like not to have your code work. But I can help. I called the save and view function in the HTML button onclick. As for your error, you may have mistyped something important.
Try watching the video again and code along. Hopefully that helps.
@@MelvinAdekanye thanks for your answer. Yeah JS is hard on me. I did what I needed but a bit differently.
You are the best!!!
it was veryyyyyyyyyy useful And thank You😉
Most welcome 😊
thanks nice !!
You are awesome...
Thank you. You're awesome.
How do I save and view at the same time?
Огромное спасибо тебе ман) Очень помогло твоё видео!
You're very welcome!
How can I do this but save it for everyone? like a voting D:, helpppp
now how do you delete an entry?
how would you then use this to .map over the array instead?
Sorry for the late response. But elaborate on this thought.
@@MelvinAdekanye what i mean't was how would you then grab this out of local storage and then use the array in a .map but worked that one out
Okay. That's great. Glad you worked it out.
the data is only saved if it was typed on one device and if you open up another computer with this same code the data is not there is there a way to fix this and have the data stored permanently if you went on another computer and the data you entered is still there? store the information globally instead locally
For sure. First of all. Local storage is meant to be saved locally on a singular device. To achieve what you're looking for. You would need to run your website on a server with a database. But that might be a stretch. So use firebase. Firebase is a free cloud database that allows you to save data and have it appear on multiple devices.
@@MelvinAdekanye thanks
Hello man,thank you for the tutorial it helped me a lot for my final project,but can you please explain how do I remove an array from a key?They are marked with indexes 0,1,2,3 under the key Value, I do it with for() or something else?
You're very welcome. Sorry for the late reply. I'm not sure what you mean. Maybe send me an email.
So thank you so muchhhhh😂
You're veryyy welcomeee!
Hi dude, great video! Is it possible to get and write only one element of the localStorage?
Yes it is. Here's a link to help: developer.mozilla.org/en-US/docs/Web/API/Window/localStorage
Thanks , very helpful !
Nne of my object's keys has an array as a value. I tried to JSON.stingify the whole thing but the content inside the array was saved an empty array ! do you know maybe why this is happening ?
No. But are there errors showing up in the logs?
How to make it show number 1 only ?
Could you please add a delete button for the delete the key and value in localStorage.getItem(); or localStorage.setItem()? I have a hard time to make a simple button for this one though.
Cheers!
Just gonna drop this here:
localStorage.setItem('text', 'Really cool text');
localStorage.removeItem('text');
Can’t people change the local storage data through web dev tools and possibly use it maliciously?
Yes. They sure can! But this is for simple programs. I agree. You should never save important data in local storage. Leave it to the server side.
❤❤love ur laugh keep laughing bro😂
Hahaha. That's awesome Thanks!!
thanks a lot bro
Always welcome
Do you have an idea on large form data that will be stored to localstorage? Our clients are complaining that they lost their data without saving so my solution supposedly is by storing it to localstorage. But after reading the 5/10mb limit, i do not know anymore. Your thoughts will be highly appreciated. Thanks
For sure. Try using Firebase. I would imaging you're using Local Storage because data can be easily saved and retrieved. But since you're noticing data loss. It would be best to store data on Firebase. It's just as easy and could be accessed on multiple devices.
Thank You SOOOO Much Broo i am working on a project and was stucked at this point cuz my local storage is replacing array values now it is solved Thanks again I am getting really frustated .....
You are soooo welcome!
Hy, That's was awesome vidoes, I just wonder why you just saved an empty array to local storage than direct saving with the data from the input. maybe you just save push the data to the array then save it to local storage than saving it twice
An array has to exist in the localstorage for us to push data into it.
thanks, but where to down load this html page
Are you asking for the source code?
@@MelvinAdekanye yes
how to append only unique value in local storage ?
Well. You would have to check if the new value matches anything in local storage. If so, remove the new data from the array and append everything else.
Man does it still stay if we refresh the tabs
Yes it does! The data remains even when you refresh the page.
thanks dude
Happy to help
Does that work with objects too?
Yes. Objects, arrays, and all other data types.
love u bro
awesome
Thanks
Nice video! I have one question. Is it possible to store an array of numbers in cookie? I am making an e-commerce website for my school project and I am currently building a shopping cart. My array contains item_IDs from the database and I want to do a for-loop to display each item with corresponding image, price and name retrieving from the database using sql and php.
Yes it is. I'll definitely make a tutorial on cookies. But here's a stack overflow page that could help. stackoverflow.com/questions/4470477/create-array-in-cookie-with-javascript
What if I wanted to delete an index because I made a typo without going to console, how would I do that? And awesome tutorial!
thank you
You're welcome
thank u , :D
NEVER use var or fucntion. The values do not change, use const. As for the function, do const view = () => { }
Agreed. Thanks for the tip.
hey Man! can you make a video that "user can update the data inside localStorage"? example, the data in sign up form, you will update it. been trying it but the new user will be push to the user :3
Oh. So updating individual items in the array/object. That's cool. But do this on the backend. Always remember, whatever is saved to Local Storage can be manually edited by the user. So depending on what you're saving, this could be a bad idea. For ex: networked_username, email, password, etc
@@MelvinAdekanye YES YES, I made settings in my app where you can edit what you have sign in in the "sign in form", that's what i'm trying to say ^^
Does it only work in HTML?
What do you mean by HTML.
@@MelvinAdekanye Like html file type (example: header.html)
@@BiassedYT Yes. It does. You would just have to write the Js part inside a script tag.
......
Js part here
@@MelvinAdekanye oh okay. Thank you.
after i refresh browser the data disappear
Does it do this for all your browsers? Or just one? If this occurs in just one browser, it may be a browser setting. If it occurs in all, do you get any errors in your console?
what a based chad you are fam
Thanks Daddy 😅🤣
I wish you provided the source code
Give more videos
For sure. Glad you like them
Awosome like u say, quit early, why man?
Lol. Don't worry. Still here. Going to drop a cool tutorial soon.
• never trust a nerd to explain simple shit online
dude can u help me , i need to complete my job assigment
You're really asking some random dude on the internet to help do your work assignments? 🤦♂️
source code dood
Try coping the video.