April 2018
Intermediate to advanced
284 pages
5h 46m
English
| Tip 46 | Maintain State Over Time with LocalStorage |
In this tip, you’ll learn how to save user data with localStorage.
Users love to personalize applications. Conversely, they hate entering the same data every time they visit an app or a page. When you’re working with front-end JavaScript, you’re in a bit of a bind. How do you preserve user data with minimal interference?
An obvious solution is to create a login. The problem is that many users will abandon a site if they’re forced to log in. A better, albeit imperfect, solution is to store data locally. When you save data locally, you can preserve information on a particular browser on a particular device.
Of course, everyone uses multiple devices. So saving data to a browser won’t help a user ...
Read now
Unlock full access