47

Storing Data Using Web Storage

In this Chapter

  • Learn how to persist data on the page using the Web Storage API

  • Understand the basics of storing, retrieving, and more

Just like Las Vegas, often what you do in a web page stays in the web page. Let’s say you have a simple application (https://bit.ly/kirupa_todo) that allows you to maintain a to-do list:

images

If you accidentally navigate to another page or close the tab this page was on, the default behavior when you return to this page would be to empty the to-do list.

Web pages do not persist data by default. Fortunately, you have a bunch of approaches you can take for solving this problem. ...

Get Javascript Absolute Beginner's Guide, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.