HTML5 APPLICATIONS DEVELOPMENT MANUAL

(lu) #1

33 - Accessing Device and Operating System


Resources


The Windows Runtime environment enables developers to access in-


memory resources as well as hardware using APIs.


As you learned in chapter 4, the Windows Runtime (WinRT) is the


operating system environment responsible for access to devices, media,


networking, local and remote storage, and other items.


The Web Storage API allows you to store data in the browser versus


a server.


There are two different types of storage:



  • localStorage - lets users save larger amounts of persistent data, there is no


limit to how long the data persists.



  • sessionStorage lets users save session state data, it only lasts for the duration


of the session.


Both objects allow users to store large amounts of data without


slowing down a connection because data is transferred only when requested.


localStorage


<!doctype html>




localStorage Example