6 function startDBWork() {
7 indexedDB
.open(parent
.location
, 1).onupgradeneeded = function(e
) {
9 if (db
.objectStoreNames
.contains("mystore")) {
10 db
.deleteObjectStore("mystore");
12 var store
= db
.createObjectStore("mystore");
13 store
.add({ hello
: "world" }, 42);
14 e
.target
.onsuccess
= madeMod
;
19 var trans
= db
.transaction(["mystore"], "readwrite");
21 objectStore("mystore");
22 trans
.oncomplete = function() {
23 parent
.postMessage("didcommit", "*");
26 store
.put({ hello
: "officer" }, 42).onsuccess = function(e
) {
27 // Make this transaction run until the end of time or until the page is
28 // navigated away, whichever comes first.
30 store
.get(42).onsuccess
= doGet
;
33 document
.location
= "about:blank";
38 <body onload=
"startDBWork();">