Changes

Jump to navigation Jump to search
m
no edit summary
Line 31: Line 31:  
     var getJohn = store.get(12345);
 
     var getJohn = store.get(12345);
 
     var getBob = index.get(["Smith", "Bob"]);
 
     var getBob = index.get(["Smith", "Bob"]);
    console.log(getJohn);
     −
     getJohn.onsuccess = function() {
+
     getBob.onsuccess = function() {
        console.log(getJohn); // => "John"
+
      console.log("updating");
 +
      getBob.result.phone = '+312';  // => "Bob"
 
     };
 
     };
 
+
    getBob = index.get(["Smith", "Bob"]);
 
     getBob.onsuccess = function() {
 
     getBob.onsuccess = function() {
         console.log(getBob);  // => "Bob"
+
         console.log(getBob.result.phone);  // => "Bob"
 
     };
 
     };
 +
   
 +
 +
    store.put(getBob.result);
    
     // Close the db when the transaction is done
 
     // Close the db when the transaction is done
530

edits

Navigation menu