Client-Side Data Storage: Keeping It Local / Edition 1

Client-Side Data Storage: Keeping It Local / Edition 1

by Raymond Camden
ISBN-10:
1491935111
ISBN-13:
9781491935118
Pub. Date:
01/21/2016
Publisher:
O'Reilly Media, Incorporated
ISBN-10:
1491935111
ISBN-13:
9781491935118
Pub. Date:
01/21/2016
Publisher:
O'Reilly Media, Incorporated
Client-Side Data Storage: Keeping It Local / Edition 1

Client-Side Data Storage: Keeping It Local / Edition 1

by Raymond Camden
$29.99 Current price is , Original price is $29.99. You
$29.99 
  • SHIP THIS ITEM
    Qualifies for Free Shipping
  • PICK UP IN STORE
    Check Availability at Nearby Stores
  • SHIP THIS ITEM

    Temporarily Out of Stock Online

    Please check back later for updated availability.


Overview

One of the most useful features of today’s modern browsers is the ability to store data right on the user’s computer or mobile device. Even as more people move toward the cloud, client-side storage can still save web developers a lot of time and money, if you do it right. This hands-on guide demonstrates several storage APIs in action. You’ll learn how and when to use them, their plusses and minuses, and steps for implementing one or more of them in your application.

Ideal for experienced web developers familiar with JavaScript, this book also introduces several open source libraries that make storage APIs easier to work with.

  • Learn how different browsers support each client-side storage API
  • Work with web (aka local) storage for simple things like lists or preferences
  • Use IndexedDB to store nearly anything you want on the user’s browser
  • Learn how support web apps that still use the discontinued Web SQL Database API
  • Explore Lockr, Dexie, and localForage, three libraries that simplify the use of storage APIs
  • Build a simple working application that makes use of several storage techniques

Product Details

ISBN-13: 9781491935118
Publisher: O'Reilly Media, Incorporated
Publication date: 01/21/2016
Pages: 116
Product dimensions: 7.00(w) x 8.90(h) x 0.40(d)

About the Author

Raymond Camden is a developer advocate for IBM. His work focuses on the MobileFirst platform, hybrid mobile development, Node.js, HTML5, and ColdFusion. He's a published author and presents at conferences and user groups on a variety of topics. Raymond can be reached at his blog (http://www.raymondcamden.com/), or via email at raymondcamden@gmail.com.

Table of Contents

Preface v

1 A Gentle Introduction to Client-Side Data Storage 1

2 Working with Cookies 3

Cookies? Seriously? 3

Working with Cookies 4

Reading Cookies 5

Deleting Cookies 6

Demos 6

Inspecting Cookies Within Developer Tools 10

Support and Recommended Usage 11

3 Working with Web Storage 13

Web Storage, AKA Local Storage 13

Working with Web Storage 14

Demos 15

Listening for Storage Changes 19

Inspecting Web Storage with Dev Tools 23

Support and Recommended Usage 24

4 Working with IndexedDB 27

Welcome to Deep Data 27

Key IndexedDB Terms 28

Checking for IndexedDB Support 29

Working with Databases 29

Working with Object Stores 31

Making Object Stores 32

Defining Primary Keys 34

Defining Indexes 36

Working with Data 37

Creating Data 38

Reading Data 42

Updating Data 45

Deleting Data 47

Getting All the Data 48

Working with Ranges and Indexes 51

Even More with IndexedDB 54

Storing Arrays 54

Counting Data 59

Inspecting IndexedDB with Dev Tools 59

Support and Recommended Usage 61

5 Working with Web SQL 63

Dead Spec Walking 63

Basic Database Terms 64

Checking for Web SQL Support 64

Working with Databases 64

Working with Transactions 66

Inspecting Web SQL with Dev Tools 72

Support and Recommended Usage 73

6 Making It Easier with libraries 75

"Use the Library, Luke…" 75

Working with Lockr 75

Simplifying IndexedDB with Dexie 80

Working with localForage 88

More Options 90

7 Building a Sample Application 91

Let's Build Something! 91

Our Sample Data 92

The Application 95

The Code 97

Wrap-up 103

Index 105

From the B&N Reads Blog

Customer Reviews