将前端的html输出来才方便别人判断...

解决方案 »

  1.   


    专题名称 专题类型 发表时间 发表ip               操作
    权威的气氛 威联通 2013-12-04 22:40:35 127.0.0.1 查看 修改 删除
    额外范围为 网件 2013-12-04 22:41:43 127.0.0.1 查看 修改 删除
    的分别是地方 网件 2013-12-04 22:44:33 127.0.0.1 查看 修改 删除
    785875857875 网件 2013-12-04 22:56:15 127.0.0.1 查看 修改 删除
    fdbsdfbs 网件 2013-12-04 22:59:51 127.0.0.1 查看 修改 删除
      

  2.   

    你把 连接 包在 button 标记中,连接能生效吗?
      

  3.   

    简单的改了下,你看看效果和做法<script>
    $(function() {
      $('.del').click(function() {
        $('#'+$(this).attr('id')).remove();
      });
    });
    </script>
    <table align="center" cellspacing="0" cellpadding="0">
    <tr>
    <th>专题名称</th>
    <th>专题类型</th>
    <th>发表时间</th>
    <th>发表ip</th>
    <th>操作</th>
    </tr>
    <tr id="1">
    <td>$row['ztname']</td>
    <td>$row['zttype']</td>
    <td>$row['zttime']</td>
    <td>$row['publiship']</td>
    <td><a href="?id=1">查看</a><button><a href="?act=up&id=1">修改</a></button><button class='del' id=1>删除</button></td>
    </tr>
    </table>
    <?php
    print_r($_GET);
      

  4.   

    可以   后台实现从数据库删除了,我想在前端页面不刷新的情况下用js将选中的这一行tr在table中删除
      

  5.   

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <script charset="utf-8" src="js/jquery.js"></script>
    <?php
    require("inc/pdo.php");
    $selectSpecialContent=$dbc->prepare("select * from naszt");
    $selectSpecialContent->execute();
    ?>
    <script>
    $(document).ready(function() {
    $('.del').bind("click".q);
    function q(){
        $('#'+$(this).attr('id')).remove();
    }
    });
    </script>
    <table align="center" cellspacing="0" cellpadding="0">
    <tr>
    <th>专题名称</th>
    <th>专题类型</th>
    <th>发表时间</th>
    <th>发表ip</th>
    <th>操作</th>
    </tr>
    <?php while($row=$selectSpecialContent->fetch()){ ?>
    <tr id="<?php echo $row['id']?>">
    <td><?php echo $row['ztname']?></td>
    <td><?php echo $row['zttype']?></td>
    <td><?php echo $row['zttime']?></td>
    <td><?php echo $row['publiship']?></td>
    <td><button>查看</button><button>修改</button><button class='del' id="<?php echo $row['id']?>">删除</button></td>
    </tr>
    <?php }; ?>
    </table>为什么点了没反应呢...
      

  6.   

    前台输出为:
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <script charset="utf-8" src="js/jquery.js"></script>
    <script>
    $(document).ready(function() {
    $('.del').bind("click".abc);
    alert("1");
    function abc(){
    alert("1");
        $('#'+$(this).attr('id')).remove();
    }
    });
    </script>
    <table align="center" cellspacing="0" cellpadding="0">
    <tr>
    <th>专题名称</th>
    <th>专题类型</th>
    <th>发表时间</th>
    <th>发表ip</th>
    <th>操作</th>
    </tr>
    <tr id="2">
    <td>27878</td>
    <td>威联通</td>
    <td>2013-12-03 23:26:45</td>
    <td>127.0.0.1</td>
    <td><button>查看</button><button>修改</button><button class='del' id="2">删除</button></td>
    </tr>
    <tr id="6">
    <td></td>
    <td>威联通</td>
    <td>2013-12-04 17:39:07</td>
    <td>127.0.0.1</td>
    <td><button>查看</button><button>修改</button><button class='del' id="6">删除</button></td>
    </tr>
    <tr id="7">
    <td>权威的气氛</td>
    <td>威联通</td>
    <td>2013-12-04 22:40:35</td>
    <td>127.0.0.1</td>
    <td><button>查看</button><button>修改</button><button class='del' id="7">删除</button></td>
    </tr>
    <tr id="8">
    <td>额外范围为</td>
    <td>网件</td>
    <td>2013-12-04 22:41:43</td>
    <td>127.0.0.1</td>
    <td><button>查看</button><button>修改</button><button class='del' id="8">删除</button></td>
    </tr>
    <tr id="9">
    <td>的分别是地方</td>
    <td>网件</td>
    <td>2013-12-04 22:44:33</td>
    <td>127.0.0.1</td>
    <td><button>查看</button><button>修改</button><button class='del' id="9">删除</button></td>
    </tr>
    <tr id="10">
    <td>785875857875</td>
    <td>网件</td>
    <td>2013-12-04 22:56:15</td>
    <td>127.0.0.1</td>
    <td><button>查看</button><button>修改</button><button class='del' id="10">删除</button></td>
    </tr>
    <tr id="11">
    <td>fdbsdfbs</td>
    <td>网件</td>
    <td>2013-12-04 22:59:51</td>
    <td>127.0.0.1</td>
    <td><button>查看</button><button>修改</button><button class='del' id="11">删除</button></td>
    </tr>
    </table>
      

  7.   

    本帖最后由 xuzuning 于 2013-12-06 16:44:47 编辑