日期:2014-05-17  浏览次数:20716 次

请问如何取到jsp上表格指定行的值


我想指定一行删除 需要提取id,下面是jsp代码

哪位能写个代码看看 谢谢

------解决方案--------------------

<table>
    <tr>
    <td>
           <a href="javascript:void(0);" onclick="javascript:doDelete(this,'张三')">删除这一行1</a>
        </td>
    </tr>
    <tr>
    <td><a href="javascript:void(0);" onclick="javascript:doDelete(this,'李四')">删除这一行2</a>
        </td>
    </tr>
    <tr>
    <td><a href="javascript:void(0);" onclick="javascript:doDelete(this,'王五')">删除这一行3</a>
        </td>
    </tr>
    <tr>
    <td><a href="javascript:void(0);" onclick="javascript:doDelete(this,'马六')">删除这一行4</a>
        </td>
    </tr>
</table>
<script language="javascript">
function doDelete(obj,username) {
    var url = "ur_page.action"
    var param = encodeURI("?username=" + username);
    url = url + param;
    //alert(url);
    //return;
    $.post(url);
        obj.parentNode.removeChild(obj);
    }
</script>