title: refresh table after ajax success
body: <p>I want to refresh my table after ajax success</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function deleteUser(id){
      $.ajax({
          url: 'insert.php',
          type: 'POST',
          data: {'submit':id}, // An object with the key 'submit' and value 'true;
          success: function (result) {
              alert(result)
          }
      }); 
      
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;table id="table-demo" style=" border:1px solid #00CCFF!important;" class="table  table-striped"&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;id&lt;/th&gt;
              &lt;th&gt;username&lt;/th&gt;
              &lt;th&gt;pass&lt;/th&gt;
              &lt;th&gt;email&lt;/th&gt;
              &lt;th&gt;level&lt;/th&gt;
              &lt;th&gt;status&lt;/th&gt;
              &lt;th&gt;last login&lt;/th&gt;
              &lt;th&gt;&lt;/th&gt;
              &lt;th&gt;&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;?php
          $usersQry="select * from admins";
          $usersQryResult=mysqli_query($dbCnn,$usersQry);
          $c=1;
          while($user=mysqli_fetch_array($usersQryResult)){
              echo"
              &lt;tr&gt;
                  &lt;td&gt;$c&lt;/td&gt;
                  &lt;td&gt;$user[user]&lt;/td&gt;
                  &lt;td&gt;$user[pass]&lt;/td&gt;
                  &lt;td&gt;$user[email]&lt;/td&gt;
                  &lt;td&gt;$user[level]&lt;/td&gt;
                  &lt;td&gt;$user[status]&lt;/td&gt;
                  &lt;td&gt;$user[lastlogin]&lt;/td&gt;
                  &lt;td&gt;&lt;i class='fa fa-pencil-square-o' title='delete'&gt;&lt;/i&gt;&lt;/td&gt;
                  &lt;td&gt;**&lt;i onclick=\"deleteUser($user[id])\" class='fa fa-trash-o ' title='edit'&gt;&lt;/i&gt;**&lt;/td&gt;                    
              &lt;/tr&gt;
              ";
              
              $c++;
          }
          ?&gt;
          
          &lt;!--insert.php --&gt;  
          if(isset($_POST['submit'])){
              $idval=$_POST['submit'];
              $query="delete from admins where id=$idval";
              $result=mysqli_query($dbCnn,$query) or die("error 100");
              echo mysqli_affected_rows($dbCnn);
              echo "## $idval";
          }
          
      &lt;/tbody&gt;
  &lt;/table&gt;</code></pre>
  </div>
  </div>
  
  after click on delete the user with posted id value to insert.php delete successfuly from admins table of data base. how is it possible refresh table after success of ajax?</p>