Im making a small private message application in the form of a phone. Ten messages are shown at the time. And the list of messages are scrolled up/down by hiding them.
Just how bad is it to use the DOM to store information in this way. My main goal for doing this is to reduce calls to the database. And instead of making a new call all the time, it only checks if any new messages has arrived and ads the new message(s).
Whats the alternative, cookies anyone?
Thank you for the time
EDIT: To clarify
The messages (id, title, date, from, content) is stored in a ul list, when scrolled the first and the last is hidden/shown.
10 elemnts is shown at the time.
By “using the DOM to store information”, do you just mean hiding elements and showing them later? In that case, I think it’s just fine. There’s no need to fetch things one at a time if you can fetch ten and just reveal them one at a time.