title: WebStorage - executeSql gives undefined is not a function in for loop
body: <p>Here is my code :</p>
  
  <p>Given an object, I'm trying to insert some data in a webStorage db. Problem is that console returns me a "undefined is not a function", and I have no clue why</p>
  
  <p>Here is a snippet of my code<div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>try {
    db = openDatabase("mca", "1.0", "db mca", 200000);
    db.transaction(function(tx) {
      tx.executeSql("CREATE TABLE IF NOT EXISTS planning_x_material(id INTEGER PRIMARY KEY AUTOINCREMENT, planning_id INTEGER, material_id INTEGER,  material_name TEXT)", []);
    }, onDbError, fillDb);
  } catch(e) {
    alert("webstorage error");
  }
  
  
  function callback_planning_material(obj) {
    console.log(obj);
    
    db.transaction(function(tx) {
      for(var k = 0; k &lt; obj.length; k++) {
        for (var i = 0; i &lt; obj[k].material.length; i++) {
          (function (k, i) {
            var planning = obj[k];
            
            var material = planning.material[i];
              
            tx.execuseSql("INSERT INTO planning_x_material(planning_id, material_id, material_name) VALUES (?, ?, ?)", [planning.id, material.id, material.name]); // here console gives me "undefined is not a function" error
          })(k, i);
        }
      }
    }, onDbError);
  }
  
  function fillDb() {
    // example object
    var obj = [
      {
        id: 1,
        name: "name 1",
        material: [
          { id: 1, name: "mat. 1" },
          { id: 2, name: "mat. 2" },
        ]
      },
      
      {
        id: 2,
        name: "name 2",
        material: [
          { id: 3, name: "mat. 3" },
          { id: 4, name: "mat. 4" },
        ]
      }
    ];
    
    
    callback_planning_material(obj);
  }</code></pre>
  </div>
  </div>
  Any idea?</p>