25.02.2013 Views

Peter Lubbers - Pro HTML 5 Programming

Pro HTML 5 Programming

Pro HTML 5 Programming

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Exploring Web Storage<br />

CHAPTER 9 ■ USING THE <strong>HTML</strong>5 WEB STORAGE API<br />

Since <strong>HTML</strong>5 Web Storage is very similar in function to cookies, it is not too surprising that the most<br />

advanced browsers are treating them in a very similar manner. Values that are stored into localStorage<br />

or sessionStorage can be browsed similar to cookies in the latest browsers, as shown in<br />

Figure 9-4.<br />

Figure 9-4. Storage values in Google Chrome’s Storage Panel<br />

This interface also grants users the ability to remove storage values as desired and easily see what<br />

values a given web site is recording while they visit the pages. Not surprisingly, the Safari browser from<br />

Apple has a similar, unified display for cookies and storage, as it is based on the same underlying WebKit<br />

rendering engine as Chrome is. Figure 9-5 shows the Safari Storage panel.<br />

Figure 9-5. Storage values in Safari’s Storage panel<br />

The Opera browsers goes one step further, by allowing users to not only browse and delete storage<br />

values but also create them as shown in Figure 9-6.<br />

223

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!