title: change value of data sent to ajax call in complete function
body: <p>I need to change the data sent to ajax call on complete function.</p>
  
  <p>Lets say I set <code>var total = 1;</code> after that ajax call started</p>
  
  <pre><code>function test(total) {
      total = total;
      alert("total : " + total);
  }
  $('#call_analysis_basic_table').DataTable( {
      "processing": true,
      "serverSide": true,
      "iDisplayLength": 100,
      "ajax":{
          type: "POST",
          url :"http://localhost:8050/phpservice/index.php", // json datasource
          data: {
              "rec" : total,
              "phone" : "d123",
              "from_date" : "14-05-2016" ,
              "to_date" : "20-09-2017"
          },
          error: function(){  
              alert("error");
          },
          complete: function(data){  
              total = data.responseJSON.recordsTotal;
              test(total);
          }
      }
  } );
  </code></pre>
  
  <p>First time the value of parameter <code>rec</code> will be <code>1</code>, in the end I changed the value of total in complete function (Lets say value of total is 20 now) .
  But when I click on page 2 of table, the ajax call started, and it again sent the value of rec to 1, and not sending 20 ?
  Why is it happening, I change the value of parameter in complete function but still in next ajax call, it gets the old value of parameter ? </p>