HTML5 Data storage

Source: Internet
Author: User
Tags sessionstorage

HTML Data storage: (Mobile, PC-side):

History:

Previous storage methods: Cookies: Small storage (4KB, stored on the server) network shutdown data disappeared;

Now: Local data storage:

1. Localstorage: Advantages: No time limit data will be saved, unless manually deleted; (common)

Writing:

Localstorage.setitem ("name", "Zhao"); Assign the Zhao to name

Adimin.value = Localstorage.setitem ("Adimin");

                                                         //   Adimin.value (i.e.   localstorage.setitem ("Adimin")   and save  =  localstorage.setitem ("Adimin", Adimin.value); &NBSP
                                                                 pass Words.value = Localstorage.setitem ("passwords");    

Assign the Passwords.value (that is, the password to be entered) to Localstorage.setitem ("passwords") and save = Localstorage.setitem ("Passwords", pass Words.value);

2.sessionStorage: Insufficient: Automatic deletion of saved data site closed data emptying

Writing:

Admin.value = Sessionstorage.admin;

Case CSS:

Show:

When we enter the value click on the next automatic login (as to save the data, do a little flaw, save data);

Click Send login; The data will be emptied;

When we send it, we enter the value again in the input box

Data saved successfully!

HTML5 Data storage

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.