HTML5 Localstorage Browser Local Storage

Source: Internet
Author: User

Application Scenarios:

When we use JSON to simulate the background data, the foreground and delete changes are put data into a JavaScript object, but this method of data can only work on a page. The advent of localstorage solved our problem!     That is, the data is stored in the browser via Localstorage, and then the localstorage is removed from another page to reference this data! For example, when you first visit a page, expand the Main Menu submenu in the page, refresh the page, the submenu has been automatically expanded (because the status has been recorded in the browser), or close the browser to reopen the page, the submenu is still expanded. code: Now there is a JSON file, click on the "Get Data" button, the contents of the JSON file read to the page. Click the button again to clear the contents. JSON file HTML code when the button is clicked, the contents of the JSON file are shown in the DIV with the ID jsontip, with Data-rel to mark the status. JS Code click the button to refresh the page

HTML5 Localstorage Browser Local Storage

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.