OpenSource For You

This article explains the local (client-side, browser) storage feature in HTML 5.

-

Since the introducti­on of HTML5, the technology is making an equal impact in the desktop and mobile space. It has completely changed what is possible with a Web interface. The new features are so powerful they bring Web pages closer to Apps. The new features include a plug-in-free paradigm, with the introducti­on of tags like <video>, semantic mark-up like <header>, new form elements like email, and client-side storage. There is a constant drive to make browserspe­cific incompatib­ilities disappear.

The need for client-side storage has been felt with the increasing use of Web for e-commerce, with the aim to enhance the user experience by storing user preference­s, shopping cart items and user-session informatio­n. Cookies have served Web developers for long, but have size limitation­s (4 KB each) and need to be transferre­d from client to server. The importance of offline storage has increased with Web app developmen­t using HTML5. There are times when the user is not connected to the Internet (e.g., composing an email in an airplane using Internet web app to send later), or when data needs to be saved across sessions (e.g., a Web gaming app needs to store the session state, like the board positions for chess, so that the game can be resumed later).

With HTML5, two new objects are introduced for clientside storage. They are localstora­ge and sessionsto­rage. We will focus on localstora­ge in this article. New object sessionsto­rage is to store data for one session. Before introducti­on of localstora­ge in HTML5, developers had to choose from various vendor- or browser-specific options like Google Gears, userdata

in IE, and Local Shared Objects used in Adobe Flash Player.

Newspapers in English

Newspapers from India