title: delay or setitimeout in ajax php codeigniter
body: <p>I have ajax call to calling a php function like this :</p>
  
  <pre><code>$('#btn-footer').click(function(e) {
              e.preventDefault();
              var id = $("#id_user_edit").val();
              var id_perusahaan = $('#id_perusahaan').val();
              //console.log(id_perusahaan);
              var nama = $('#nama_edit').val();
              var username = $('#username_edit').val();
              var password = $('#password_edit').val();
              var departement = $('#kode_Departement_edit').val();
              var jabatan = $('#jabatan').val();
              var perusahaan = $('#kode_perusahaan_edit').val();
  
              $.ajax({
                  url: '&lt;?php echo base_url() . 'control_member/update_user' ?&gt;',
                  type: 'POST',
                  data: {id: id,
                      id_perusahaan: id_perusahaan,
                      nama: nama,
                      username: username,
                      password: password,
                      departement: departement,
                      jabatan: jabatan,
                      perusahaan : perusahaan
                  },
                  dataType: 'json',
                  success: function(obj) {
  
                      alert('Update Success');
                      location.reload();
                  }
              });
          });
  </code></pre>
  
  <p>this is the html :</p>
  
  <pre><code>&lt;div class="modal-body"&gt;
              &lt;div class="box-content"&gt;
  
                  &lt;form class="form-horizontal"&gt;
                      &lt;fieldset&gt;
                          &lt;div class="control-group"&gt;
                              &lt;label class="control-label"&gt;User's id : &lt;/label&gt;
                              &lt;div class="controls"&gt;
                                  &lt;input class="input-xlarge focused" name="id_user_edit" id="id_user_edit" autofocus&gt;
                                  &lt;select id="id_perusahaan" name="kode_perusahaan"&gt;
                                      &lt;option&gt;PS&lt;/option&gt;
                                      &lt;option&gt;JFS&lt;/option&gt;
                                      &lt;option&gt;SLA&lt;/option&gt;
                                  &lt;/select&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
  
                          &lt;div class="control-group"&gt;
                              &lt;label class="control-label"&gt;Nama User : &lt;/label&gt;
                              &lt;div class="controls"&gt;
                                  &lt;input class="input-xlarge focused" name="nama" id="nama_edit"&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
  
                          &lt;div class="control-group"&gt;
                              &lt;label class="control-label"&gt;Nama Login : &lt;/label&gt;
                              &lt;div class="controls"&gt;
                                  &lt;input class="input-xlarge focused" name="username" id="username_edit"&gt;                                    
                              &lt;/div&gt;
                          &lt;/div&gt;
  
                          &lt;div class="control-group"&gt;
                              &lt;label class="control-label"&gt;Password : &lt;/label&gt;
                              &lt;div class="controls"&gt;
                                  &lt;input type="password" name="password" id="password_edit"&gt;                                    
                              &lt;/div&gt;
                          &lt;/div&gt;
  
                          &lt;div class="control-group"&gt;
                              &lt;label class="control-label"&gt;Departement : &lt;/label&gt;
                              &lt;div class="controls"&gt;
                                  &lt;select id="kode_Departement_edit" name="kode_Departement"&gt;
                                      &lt;option&gt;Accounting&lt;/option&gt;
                                      &lt;option&gt;Armada&lt;/option&gt;
                                      &lt;option&gt;Ekspor &amp; Impor&lt;/option&gt;
                                      &lt;option&gt;Finance&lt;/option&gt;
                                      &lt;option&gt;HRD&lt;/option&gt;
                                      &lt;option&gt;Inventory&lt;/option&gt;
                                      &lt;option&gt;IT&lt;/option&gt;
                                      &lt;option&gt;Legal &amp; Claim&lt;/option&gt;
                                      &lt;option&gt;Marketing&lt;/option&gt;
                                      &lt;option&gt;Operational&lt;/option&gt;
                                      &lt;option&gt;Purchasing&lt;/option&gt;
                                  &lt;/select&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
  
                          &lt;div class="control-group"&gt;
                              &lt;label class="control-label"&gt;Jabatan : &lt;/label&gt;
                              &lt;div class="controls"&gt;
  
                                  &lt;select id="jabatan" name="jabatan"&gt;
                                      &lt;option&gt;Administrator&lt;/option&gt;
                                      &lt;option&gt;MD&lt;/option&gt;
                                      &lt;option&gt;Manager&lt;/option&gt;
                                      &lt;option&gt;Assisten Manager&lt;/option&gt;
                                      &lt;option&gt;Kepala Bagian&lt;/option&gt;
                                      &lt;option&gt;Staff&lt;/option&gt;
                                  &lt;/select&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
  
                          &lt;div class="control-group"&gt;
                              &lt;label class="control-label"&gt;Perusahaan : &lt;/label&gt;
                              &lt;div class="controls"&gt;
  
                                  &lt;select id="kode_perusahaan_edit" name="perusahaan"&gt;
                                      &lt;option&gt;Tresnamuda Sejati&lt;/option&gt;
                                      &lt;option&gt;Jameson Freight Semesta&lt;/option&gt;
                                      &lt;option&gt;Meridian Port&lt;/option&gt;
                                      &lt;option&gt;Samudera Daka Lines&lt;/option&gt;
                                      &lt;option&gt;SLA&lt;/option&gt;
                                  &lt;/select&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                      &lt;/fieldset&gt;
              &lt;/div&gt;                    
          &lt;/div&gt;
  </code></pre>
  
  <p>I want to adding some delay or setTimeOut in ajax jquery. The html above (this is a modal bootstrap) is used to update some data in a row of a table. The problem is : when I updating all of the data, the data is not updating. I dont know how, because JSON that was created is true. I think, with setTImeout, updating will be success, How an I make it true ?</p>