OPEN AN INDEXEDDB DATABASE

Before you can access an IndexedDB object store, you must first open its database context. An IndexedDB database serves two purposes: It houses a series of object stores under a common identification banner, and it serves to offer version control snapshots of the collection of object store schemas at different states.

For the sake of simplicity, and because the IndexedDB API version control is not yet fully supported by browsers, this chapter assumes that the database remains at version 1.0, and no version control is used. “1.0” is used when creating an IndexedDB database in the following section, “Create a New IndexedDB Object Store.”

 var db, database = 'myDatabase'; var openDB = indexedDB.open(database); openDB.onsuccess ...

Get HTML5: Your visual blueprint™ for designing rich web pages and applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.