Browser storage in jQuery

Browser storage in jQuery

  1. localStorage.setItem()的使用

Using a function localStorage.setItem(key,data)which is a string parameter passed, the name is stored in the browser, and the other is a data, an object is typically passed, need to pay attention to the object JSON.stringify()to convert it to a string.

2. localStorage.getItem(key)
This function reads data from the browser by passing in a stored name

3. Practice
imitation ToDolist website
code, see imitation todolist Code

Guess you like

Origin blog.csdn.net/weixin_47450807/article/details/108866663