title: Wrapping a single variable callback function with more variables javascript
body: <p>Okay I've been working on this for a few days and I haven't found any examples that have helped for this instance. This seems like a very common scenerio so maybe I am just not looking in the right spot, or maybe the solution is more complicated than I want it to be. </p>
  
  <p>I have a pre-built function, transaction, that takes the callback function queryDB. </p>
  
  <pre><code>db.transaction(queryDB, errorCB, successCB);
  </code></pre>
  
  <p>By design queryDB will have a "tx" or database transaction object to make the SQL call.</p>
  
  <pre><code>function queryDB(tx){
     alert("transact");
     tx.executeSql("SELECT * FROM Sound", [], rqDB, errorCB);
  }
  </code></pre>
  
  <p>Now I want to pass some extra variables to queryDB, in particular sqlCmd and a results callback function. I have tried a number of ways of wrapping queryDB, the one I like the most looks like this:</p>
  
  <pre><code>db.transaction({
      onQueryDB: function(tx) {
          queryDB(tx,sqlCmd,cb);
      }
  }, errorCB, successCB);  
  </code></pre>
  
  <p>But this does not call my queryDB function. This seems like something that should be simple and common in javascript. Can someone please help? </p>