Answer the question
In order to leave comments, you need to log in
Loading data from LocalStorage?
I'm learning javascript, specifically Backbone. I'm looking through the code of this application todomvc.com/examples/backbone
I can't figure out where in the code the data is loaded from LocalStorage. It seems like the "reset" event of the collection is being listened to. Does the collection's reset event fire when the page is reloaded? And another question, I didn’t understand in which part of the code the data is saved in LocalStorage
Answer the question
In order to leave comments, you need to log in
It uses https://github.com/jeromegn/Backbone.localStorage
And the collection accordingly has a field:
Now the collection will work with localStorage, and the data will be taken and saved from there.
look for the line localStorage.getItem
for more details about local storage - htmlbook.ru/html5/storage
and after a quick look - work with local storage like here - https://github.com/tastejs/todomvc/blob/gh-pages/e.. .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question