Skip to content

Instantly share code, notes, and snippets.

@buzzdecafe
Created October 4, 2013 00:38
Show Gist options
  • Select an option

  • Save buzzdecafe/6819311 to your computer and use it in GitHub Desktop.

Select an option

Save buzzdecafe/6819311 to your computer and use it in GitHub Desktop.
indexedDB API exercise
// assuming we have indexedDB
var version = 3;
var dbConn = indexedDB.open("db", version);
var db;
dbConn.onerror = function(e) {
console.log('error connecting to be');
};
dbConn.onsuccess = function(e) {
db = e.target.result;
};
if (!db.objectStoreNames.contains("store")) {
db.createObjectStore("store", { keyPath: 'id' });
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment