title: Chrome Extension: Data is not being inserted nor fetched
body: <p>I am using WebSQL. I am trying to add data in Async Block which is making data not to be inserted. Code is given below:</p>
  
  <pre><code>function fetchData(){
  
      var xhr = new XMLHttpRequest();
      xhr.open("GET", "http://localhost/x/fetch.php", true);
      xhr.onreadystatechange = function() {
          if (xhr.readyState == 4) {
              // JSON.parse does not evaluate the attacker's scripts.
              var resp = xhr.responseText;
              if(resp != null) {
                  var json = JSON.parse(resp)
                  console.log(resp);
                  var data = json['data'];
                  if(data != null) {
                      openDatabase('documents', '1.0', 'documents', 5*1024*1024, function (db) {
                          alert('Called'); // This is called after below two calls.
                          insertRecord(db);
                          fetchRecord(db);
                      });
                      //var dbConnection = openDbConnect();
                      //createTable(dbConnection);
  
                      for(var a=0;a &lt;= data.length;a++) {
                          alert(data[a].title);
                      }
                  }
  
              }
  
          }
      }
      xhr.send();
  }
  </code></pre>
  
  <p><strong>JSON Dump</strong></p>
  
  <pre><code>{"data":[{"id":"1","title":"- Parts I &amp; II”,”CODE”:”xxx”,”product_url":"http:\/\/www.example.com","image_url":"http:\/\/ecx.images-example.com\/images\/I\/61ujIIMyW7L.jpg","price":"$25.00"},{"id":"2","title”:”AJDJDDJDr”,”Code”:”XX”,”product_url":"http:\/\/www.example.com","image_url":"http:\/\/dc.images-example.com\/images\/I\/41jFVZL72YL.jpg","price":"$10.99"}]}
  </code></pre>