Wednesday, October 9, 2013

JavaScript HTML5 Local Storage Tutorial

The HTML5 local storage feature allows a web application to persist object state across the browser sessions. The obvious choice would be a JSON-formatted data structure.

This nice tutorial shows the local storage in action with a simple contacts database CRUD scenario.

Remarkable is that the author used only HTML5 and JavaScript to build this sample, without adding neither an external library nor an GUI framework, thus opening (for me) the opportunity of coding it "a la Carlos" - only if time permits.

You can check the full markup and JavaScript code by browsing the application's home page source.

The full article is here and the working application (I tested under both Firefox and Chrome) can be launched from this link.

As of 8/18/2015, I was interested in keeping some e-mail templates stored locally, so for the sake of feasibility, I modified ths code example, changing the e-mail input tag into a textarea.  Check this JsFiddle snippet to se how it looks like.

A more complete article featuring HTML5 evolution can be found here.

No comments:

Post a Comment