HTML5 local storage and HTML5 Storage
1. sessionStorage
2. localStorage
3. Database Storage
4. globalStorage
5. Compatibility
References
Local persistent storage has always been an advantage of
. Here is the data stored in the table. Use of local storage://Create an Entity array varcachearray=newcachearrayutil (); one,//splice save to local object varobject= {"Waybillcode": Waybillcode, "operationdate": Operationdate, "Scantime": Scantime, "Sonno": SonNo, "ParcelNumber ":p arcelnumber," weight ": Weight," Sca
already exists, and if the database does not exist, it can also create a database. Several parameter meanings are:
1, database name.
2, the database version number, at present to pass a 1.0 on it, of course, can not fill;
3, the description of the database.
4, set the size of the allocated database (in kilobytes).
5, the callback function (can be omitted).The database is created at the first call, and then the connection is established.
(2) The Db.transaction metho
simple demo adds the company attribute to the contact person to save the JS code:[JavaScript]View Plaincopy
Save data
function Save () {
var contact = new Object;
Contact.user_name = document.getElementById ("user_name"). Value;
Contact.mobilephone = document.getElementById ("Mobilephone"). Value;
Contact.company = document.getElementById ("Company"). Value;
var str = json.stringify (contact);
Localstorage.setitem (CONTACT.MOBI
database does not exist, it can also create a database. Several parameter meanings are:
1, database name.
2, the database version number, at present to pass a 1.0 on it, of course, can not fill;
3, the description of the database.
4, set the size of the allocated database (in kilobytes).
5, the callback function (can be omitted).The database is created at the first call, and then the connection is established.
(2) The Db.transaction method can set a callback functi
Explore the use of HTML5 local storage functions and html5 storage skills
To implement a simple application, the user enters the user name and mobile phone number in the application. The attack can be saved to the local device, and basic operations such as search and display can be performed.The following is only the k
In the previous article web storage of HTML5 local storage, we briefly introduced how to use localstorage to implement local storage. In fact, apart from sessionstorage and localstorage, HTML5 also supports local data
;head>title>Localstoragetitle>head>body>div id="x">div>script type="Text/javascript"> var x = document.getElementById ("x"); //Read data x.innerhtml = Localstorage.getitem ("1");script>body>html>Two pages will show "moon Light in front of the bed".Note here: The data stored between different browsers is independent of each other, and if the data stored by IE is used, then the use of WebKit is not readable. so two files must be used in the same browser
Local Storage-webStorage, storage-webStorage
WebStorage provides a way for websites to store information on your local computer and obtain it as needed. This concept is similar to cookie. The difference is that it is designed for larger storage capacity. The Cookie size is l
This article mainly introduces simple use examples of localstorage, local database, and sessionStorage for html5 local storage. If you need it, you can refer to a very cool function of html5. it is web storage, similar to the previous cookie, however, the difference is that web sto
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 () star
A very cool feature of HTML5 is the Web storage, similar to the previous cookie, but unlike this, the Web Storage has a local capacity of 5 trillion to store, while a cookie is only 4 K, which is a completely different advantage.Webstrange is also divided into: localstorage,sessionstorage and local databases.Next I wil
HTML> HTML> Head> Metacharset="Utf-8"> title> Local Storage localstorage title> Head> Body> inputid="MSG"type="Text"/> inputid="SetData"type="button"value="Save Data"/> inputid="GetData"type="button"value="Get Data"/> Scripttype="Text/javascript">window. onload =function() {Alert ("When you close this page or close the browser, the data saved in the localstora
of the elements in the array.Shift () deletes and returns the first element of the arraySlice () returns the selected element from an existing arraySort () Sorts the elements of an arraySplice () Deletes the element and adds a new element to the array.Tosource () returns the source code of the object.ToString () converts the array to a string and returns the result.toLocaleString () converts the array to a
High-performance JavaScript data storage and javascript Data Storage
1. Four Basic Data Access Locations in JavaScript: literally, local variables, array elements, and object members.
G
.
Because it is a NoSQL database, we can set our JavaScript objects and indexes according to our actual needs.
Working in asynchronous mode, each transaction has a moderately granular lock. This allows you to work within JavaScript's event-driven modules.
Insufficient
The spec doesn't support it.
Because of the use of the SQL language, we need to master and transform our
storage. A simple application is to record the number of times a user accesses a page.
Figure 2 Comparison of buckets
Next, we will introduce how to use local storage to save user data.
Localstorage provides five methods, namely setitem (), getitem (), removeitem (), key (), and clear (), and an attribute length. The specific definitions are as follows:
g_dwnumber of the A thread is manipulated, and when the B thread is manipulated, the g_dwnumber of the B thread is manipulated.Actually very simple, introduce the TLS APIA total of 4respectively:TlsAlloc allocating thread-local storage spaceTlsFree releasing thread-local storage spaceTlsGetValue gets the value inside
storage in a modern browser is very simple, and we just need to call the Localstorage object's methods or properties directly in the JavaScript code to OK.
Stores the username ' Jkrush ',
//Then get the username.
Localstorage.setitem (' username ', ' jkrush ');
var userName = Localstorage.getitem (' UserName ');
Above, we implement data storage and
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.