title: How to do an action in DB without reloading page with JavaScript?
body: <p>I've wrote a code which retrieve some data in table and each row has a two button which is responsible for updating database with a fixed value for that row and deleting the row. I want to do these actions without reloading page.
  here is my table code:</p>
  
  <pre><code>&lt;table id="example1" class="table table-bordered table-striped"&gt;
      &lt;thead&gt;
      &lt;tr&gt;
          &lt;th&gt;نام کاربر&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
      while ($users = mysqli_fetch_assoc($result_user)) {
          ?&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;?php echo $users['name']?&gt;&lt;/td&gt;
              &lt;td&gt;&lt;?php echo $users['email']?&gt;&lt;/td&gt;
              &lt;td&gt;
                  &lt;div class="btn-group"&gt;
                      &lt;button name="btn_confirm" type="button" class="btn btn-success btn-flat"&gt;تایید&lt;/button&gt;
                      &lt;button type="button" class="btn btn-success btn-flat dropdown-toggle" data-toggle="dropdown"&gt;
                          &lt;span class="caret"&gt;&lt;/span&gt;
                          &lt;span class="sr-only"&gt;Toggle Dropdown&lt;/span&gt;
                      &lt;/button&gt;
                      &lt;ul class="dropdown-menu" role="menu"&gt;
                          &lt;li&gt;&lt;a name="btn_delete" href="#"&gt;حذف&lt;/a&gt;&lt;/li&gt;
                      &lt;/ul&gt;
                  &lt;/div&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
      &lt;?php }?&gt;
      &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>