There is a feature in HTML5 that enables you to store named key/value pairs in the local storage of your browser. The advantage over using regular cookies is that your data is never send to the remote web server and that you can store a lot more compared to the 4KB limitation of cookie storage space.
As the local storage is a feature making part of the HTML5 specification, only modern browser supports is;
Safari 4.0, Opera 10.5,IE8, FireFox 3.5, Chrome 4.0 and IOS above version 2.0.
As for any feature of HTML5 before using it you should check if your browser supports the feature:
To store or retrieve an item from the local storage:
To clear an item from the local storage or remove all items:
With this feature we are now able to build web applications that can work offline. Here under I build an application that stores persons profiles in the local storage. I use the JSON.stringify method to serialize the persons before storing the JSON strings in the local storage and JQuery to retrieve the values and bind the events:
HTML5 enables new possibilities for all types of scenarios like creating IPAD/IPhone web applications without having to program in objective c and/or upload the app to the app store. In a future post I will demonstrate how you can extend this application to create such an application.