title: websql Insert statement in loop , data source - json
body: <p>After hours of hit and trial this code has finally worked after looking at various posts for help. But i want someone to help me understand the function(i,dat) , what does this means ? Here is my full code below -</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function get_assignedtasks_first_time(){
  var jdata=$.getJSON( "http://45.114.246.107/quicktask/webservice/admtask.php?entdt=&amp;entusr=SAURABH&amp;company=&amp;taskno=&amp;status=&amp;priority=&amp;primary=", function( data ) {
  
  db.transaction(function (tx) { 
  
      $.each(data, function(i, dat) {
                  tx.executeSql('INSERT INTO tasks (sno, taskdesc) VALUES("'+data[i]['SNO']+'", "'+data[i]['TASKDESC']+'")');
              });
              alert("completed");
  
  }); 
              }); 
  }</code></pre>
  </div>
  </div>
  </p>