title: Why is db.transaction not working with indexeddb?
body: <p>I am new at using inxededdb and am trying to get data out of a store. The store contains data, but for some reason the code stops after trying to set the var tx. If I am missing anything please let me know. Here is the function with which I am trying to get the book: </p>
  
  <pre><code>function getBook(){
      var tx = db.transaction("book", "readonly");
      var store = tx.objectStore("book");
      var index = store.index("by_getid");
  
      var request = index.get("&lt;?php echo $_GET['book'] ?&gt;");
      request.onsuccess = function() {
        var matching = request.result;
        if (matching !== undefined) {
           document.getElementById("text-container").innerHTML = matching.text;
        } else {
          alert('no match');
          report(null);
        }
      };
  }
  </code></pre>
  
  <p>Solved Version:</p>
  
  <pre><code>function getBook(){
    var db;
    var request = indexedDB.open("library", 1);  
  
    request.onsuccess = function (evt) {
      db = request.result; 
      var transaction = db.transaction(["book"]);
      var objectStore = transaction.objectStore("book");
      var requesttrans = objectStore.get(&lt;?php echo $_GET['book'] ?&gt;);
  
      requesttrans.onerror = function(event) {
  
      };
  
      requesttrans.onsuccess = function(event) {
        alert(requesttrans.result.text);
      };      
    };
  }
  </code></pre>