Leakbali
w3 Tutorial, Web Tutorial
Register   Login
Share

The localStorage Method 


The localStorage method stores the data with no time limit. The data will be available the next day, week, or year.

How to create and access a localStorage:
<script type="text/javascript">
localStorage.lastname="Smith";
document.write(localStorage.lastname);
</script>
The following example counts the number of times a user has visited a page:
<script type="text/javascript"> if (localStorage.pagecount)
{
localStorage.pagecount=Number(localStorage.pagecount) +1;
}
else
{
localStorage.pagecount=1;
}
document.write("Visits "+ localStorage.pagecount + " time(s).");
</script>
More Tutorial
  1. HTML5 - Storing Data on the Client
  2. HTML5 - The localStorage Method
  3. HTML5 - The sessionStorage Method

Tutorial


References

About Us

Home
About Us
Contact Us
Sitemap

Tools

Google PageRank
Alexa Rank
Keywords Density

Accounts

Register Account
Login
Valid XHTML 1.0 TransitionalValid CSS!
Web Directory


2006 - 2012 © Leakbali.com - Free Web Tutorial, Free Web Articles, Web Sharing, Source Codes, Web References