Share your repls and programming experiences

← Back to all posts
Notes taking app
02lan (16)

Its not the best but its still good

Comments
hotnewtop
02lan (16)

It now stores your notes enjoy:).

QuickV (114)

nice!... One idea is to make it so the notes stay (even if you refresh the page!)

02lan (16)

@QuickV Yea ive been trying to find out a way of doing that. But i've just started with front end and don't want to rush to backend. I don't know if i could store them in a json file instead of a database.

QuickV (114)

I'm pretty sure you can save it without having to do something in backend. I haven't actually done that myself (since I'm terrible at coding), but a friend of mine has done that in a similar kind of project.

So I guess it's possible xD.

02lan (16)

@QuickV lol yea ill figure it out.

JakeHu2020 (32)

@QuickV @02lan you can with localStorage (stores only for one user):

// Set Item
localStorage['item_name'] = 'item_value'

// get Item
alert(localStorage['item_name']);

// delete item 
localStorage.removeItem('item_name');

// clear storage
localStorage.clear();
02lan (16)

@JakeHu2020 that can work I can have all of the notes innerHTML stored in a array and store it in a localStorage.Then I can keep a count of how many notes there are and do a for loop and draw them out. I think i might just do that thank you.

JakeHu2020 (32)

@02lan use JSON.stringify when inserting, because it turns all objects and functions to strings

QuickV (114)

hopefully that works! @02lan

02lan (16)

@QuickV Yea it works for sure I had to fix some bugs. But there might be a small chance theres still a bug in there but idk. But it should save all your notes and save all your changes to your notes.

QuickV (114)

Nice! An idea is to make the notes delete once nothing is in them (though I have no idea how to do that)[email protected]

02lan (16)

@QuickV wym nothing is in them and also when you delete them it saves the ones you deleted.So when you reload the window it should be gone.

QuickV (114)

I meant when 0 characters are inside of a note, it should delete by itself, without the user having to delete them by pressing the "X". @02lan

02lan (16)

@QuickV Why tho i mean you can leave it blank and, then edit it later.

QuickV (114)

that is true lol... @02lan