Backbone.jsのサンプルの一つに上がってるtodos.jsを読んでみると、どうもbackbone-localstorage.jsを使えばかなり簡単にデータを保存できるらしい。 backbone-localstorage.jsとは A simple module to replace Backbone.sync with localStorage-based persistence. Models are given GUIDS, and saved into a JSON object. Simple as that. backbone-localstorage.js window.TodoList = Backbone.Collection.extend({ model: Todo, localStorage: new Store("todos"), // これ // ... }
![backbone-localstorage.jsを使うとかなり簡単にデータの保存ができる - Qiita](https://cdn-ak-scissors.b.st-hatena.com/image/square/ead4cc3e2db428a7e8ae43623d26ec246e058f8c/height=288;version=1;width=512/https%3A%2F%2Fqiita-user-contents.imgix.net%2Fhttps%253A%252F%252Fcdn.qiita.com%252Fassets%252Fpublic%252Fadvent-calendar-ogp-background-7940cd1c8db80a7ec40711d90f43539e.jpg%3Fixlib%3Drb-4.0.0%26w%3D1200%26mark64%3DaHR0cHM6Ly9xaWl0YS11c2VyLWNvbnRlbnRzLmltZ2l4Lm5ldC9-dGV4dD9peGxpYj1yYi00LjAuMCZ3PTk3MiZoPTM3OCZ0eHQ9YmFja2JvbmUtbG9jYWxzdG9yYWdlLmpzJUUzJTgyJTkyJUU0JUJEJUJGJUUzJTgxJTg2JUUzJTgxJUE4JUUzJTgxJThCJUUzJTgxJUFBJUUzJTgyJThBJUU3JUIwJUExJUU1JThEJTk4JUUzJTgxJUFCJUUzJTgzJTg3JUUzJTgzJUJDJUUzJTgyJUJGJUUzJTgxJUFFJUU0JUJGJTlEJUU1JUFEJTk4JUUzJTgxJThDJUUzJTgxJUE3JUUzJTgxJThEJUUzJTgyJThCJnR4dC1hbGlnbj1sZWZ0JTJDdG9wJnR4dC1jb2xvcj0lMjMzQTNDM0MmdHh0LWZvbnQ9SGlyYWdpbm8lMjBTYW5zJTIwVzYmdHh0LXNpemU9NTYmcz1mNmIzMmU1NGM5OTYwYjhjMjZiMmY4NzZhMTQ3YWM4OQ%26mark-x%3D120%26mark-y%3D96%26blend64%3DaHR0cHM6Ly9xaWl0YS11c2VyLWNvbnRlbnRzLmltZ2l4Lm5ldC9-dGV4dD9peGxpYj1yYi00LjAuMCZoPTc2Jnc9OTcyJnR4dD0lNDBrb255JnR4dC1jb2xvcj0lMjMzQTNDM0MmdHh0LWZvbnQ9SGlyYWdpbm8lMjBTYW5zJTIwVzYmdHh0LXNpemU9MzYmdHh0LWFsaWduPWxlZnQlMkN0b3Amcz04ZTM5YjZkNjA0ZmUzMDVmZmE0NTIzMDM5NWVkMDNiZg%26blend-x%3D120%26blend-y%3D500%26blend-mode%3Dnormal%26s%3De782fc592182110e6c2aee49900ed7d7)