H5 local storage and H5 Storage
They can store: array json data image script style files;
The client stores two:
1. localStorage data storage with no time limit ()
Methods include:. localStrage. getItem (); localStrage. setItem (); removeItem (); localStrage. key () starts from 0;. localStrage, clear ();
To store an image, you must use a canvas with the same size as the image and render it to the canvas. Use the toDateURL () method of the canvas to store the image locally. Use try () catch (e) {}. Obtain and render the cached data locally.
Note:. Before use, make sure that the browser supports,
B. When writing data, you need to handle exceptions to avoid errors when the capacity is exceeded.
C. Avoid storing sensitive information in localStrage
D. Key uniqueness
Restrictions:. Storage update policy and expiration Control
B. Sub-domain names cannot share stored data
C. How can I store data after the storage size is exceeded,
D. How to obtain the server ()
2. sessionStorage session-based Data Storage
The rest can follow this address: http://www.cnblogs.com/xiaowei0705/archive/2011/04/19/2021372.html