Sử dụng delegate hoặc on làm sống lại các thẻ (ok)

C:\xampp\htdocs\admin\index.php

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>Quản lý chuyên mục</title>
  <link rel="stylesheet" type="text/css" href="css/style.css">
  <script src="js/jquery.js"></script>
  <script src="js/browser_center.js"></script>
  <script src="js/category.js"></script>
</head>
<body>
  <div id="popup-background">
    <div id="popup">
      <div id="table-ajax">
        <div>
          <h3></h3>
          <img src="images/close.png" id="close" />
        </div>
        <form>
          <table>
            <tr>
              <td>Tên mới</td>
              <td><input type="text" id="txtname" /></td>
            </tr>
            <tr>
              <td></td>
              <td><input type="submit" class="submit" /><input type="submit" value="Thoát" id="cancel" /></td>
            </tr>
          </table>
        </form>
      </div>
    </div>
  </div>
  <div style="height:20px;width:100%;">Phần top</div>
  <div style="height:20px;width:100%;">Phần menu</div>
  <div id="table-list">
    <div>
      <h3>Quản lý chuyên mục</h3>
      <button id="add"><span class="icon-add"></span>Thêm</button>
    </div>
    <table>
      <tr>
        <th style="width:100px;">STT</th>
        <th>Chuyên mục</th>
        <th style="width:100px">Edit</th>
        <th style="width:100px;">Delete</th>
      </tr>
      <?php
        require("library/config.php");
        $result=mysqli_query($con,"select cate_id,cate_title from category");
        $stt=1;
        while($data=mysqli_fetch_assoc($result)){
          echo"<tr>";
            echo"<td>$stt</td>";
            echo"<td>$data[cate_title]</td>";
            echo"<td><a href='javascript:void(0)' data-id='$data[cate_id]' class='edit'><span class='icon-edit'></span>Edit</a></td>";
            echo"<td><a href='javascript:void(0)' data-id='$data[cate_id]' class='del-ajax'><span class='icon-delete'></span>Delete</a></td>";
          echo"</tr>";
          $stt++;
        }
        mysqli_close($con);
      ?>
    </table>
  </div>
  <div style="height:20px;width:100%;">Phần bottom</div>
</body>
</html>

C:\xampp\htdocs\admin\js\category.php

C:\xampp\htdocs\admin\js\category.js

Hoặc

C:\xampp\htdocs\admin\js\category.js

C:\xampp\htdocs\admin\js\xuly_category.php

C:\xampp\htdocs\admin\js\xuly_delete_category.php

89KB
Open

Last updated

Was this helpful?