So I'm searching for a good crash course on localstorage and interacting with it in Javascript. I want to build a to-do list webapp with some extra functionality but it would be just for 1 user. I don't want to mess with php/mysql and have the server doing anything. Links to tutorials would be best :-D
localStorage is similar to sessionStorage , except that while localStorage data has no expiration time, sessionStorage data gets cleared when the page session ends — that is, when the page is closed.
localStorage is a property that allows JavaScript sites and apps to save key-value pairs in a web browser with no expiration date. This means the data stored in the browser will persist even after the browser window is closed.
Local Storage data will not get cleared even if you close the browser. Because it's stored on your browser cache in your machine. Local Storage data will only be cleared when you clear the browser cache using Control + Shift + Delete or Command + Shift + Delete (Mac)
Here's a crash crash course I found very useful. It explains a bunch of HTML5 concepts, including localStorage, video tag, offline websites, forms, locations, canvas, and more.
http://diveintohtml5.org/storage.html
There is the offical documentation:
http://dev.w3.org/html5/webstorage/
For a quick demo with code: http://html5demos.com/storage also more html5 demos at the root of that site.
Note there are also things like the YUI 2 Storage Utility which abstract the storage for you (HTML 5, Google Gears, SWF) depending on what the browser supports:
The Storage Utility provides a mechanism for storing significant amounts of textual data, client-side, whether or not your browsers supports the proposed HTML 5 Storage specification.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With