HTML5 web storage, better than cookies. more secure and fasterdata store in name/value pairsthe storage limit is at least 5 MB 1. development Process: 2. browser support: 3. HTML5 Web Storage provides the following two types of objects: window. localStorage-stores data with no expiration date does not have an expiration date sessionStorage-stores data for one session (data is lost when the tab is closed). the following uses localStorage as An Example 4. basic usage: Determine whether the browser supports copying the Code if (typeof (Storage)! = "Undefined") {// Code for localStorage/sessionStorage.} else {// Sorry! No Web Storage support ..} use the copy code: copy the code localStorage. setItem ("name", "wish"); // storelocalStorage. name = "wish"; localStorage ["name"] = "wish"; localStorage. getItem ("name"); // retrieve localStorage. removeItem ("name"); // remove localStorage. clear (); // Delete All localStorage. key (I); // get key copy code Note: localStorage calltostring on all stored values. therefore, if it is a number or other types, it will also be converted to String 5. for example, in google resource, view: removeItem and modify the log to disappear. Simple page access count: Use localStorage: copy the Code if (localStorage. visitcount) {localStorage. visitcount = Number (localStorage. visitcount) + 1; // type to be converted} else {localStorage. visitcount = 1;} document. getElementById ("visitTimes "). innerHTML = "You have visited" + localStorage. visitcount + "time (s ). "; Use sessionStorage to copy the Code if (sessionStorage. visitcount) {sessionStorage. visitcount = Number (sessionStorage. visitcount) + 1; // type to be converted} else {sessionStorage. visitcount = 1;} document. getElementById ("visitTimes "). innerHTML = "You have visited" + sessionStorage. visitcount + "time (s ). "; copy Code 6. store on github. js is based on localStorage: store. js exposes a simple API for cross browser local storage no compatibility problem: store. js uses localStorage when available, and falls back on the userData behavior in IE6 and IE7 storage will not tostring: store. js uses JSON. stringify () and JSON. parse () on each call to store. set () and store. get () is basically used as follows: copy the code store. set ('name', 'wish ') // Store. get ('name') // Get store. remove ('username') // Remove 'name' store. clear () // Clear all keys