【发布时间】:2016-05-13 11:42:51
【问题描述】:
对不起,我的菜鸟问题,但我的 JSP 页面上有一个由 servlet 填充的表:
表格
<table id="tableusers" class="table table-striped table-bordered bootstrap-datatable datatable">
<thead>
<tr>
<th>Nom</th>
<th>Prénom</th>
<th>Adresse</th>
<th>email</th>
</tr>
</thead>
<tbody>
<tr>
</tr>
</tbody>
</table>
JavaScript
$.get('/SRV/webUserServlet', function(responseJson) {
if (responseJson != null) {
var table1 = $("#tableusers");
$.each(responseJson, function(key, value) {
var rowNew = $("<tr><td></td><td class=\"center\"></td><td class=\"center\"></td><td class=\"center\"></td></tr>");
rowNew.children().eq(0).text(value['nom']);
rowNew.children().eq(1).text(value['prenom']);
rowNew.children().eq(2).text(value['adresse']);
rowNew.children().eq(3).text(value['email']);
rowNew.appendTo(table1);
});
}
});
表格已正确填写,但我尝试了多个 jQuery javascript 从该表格中选择多行并将选择行的结果发送到另一个 servlet 但不幸的是,由于内容是动态的,我无法使任何 JS 脚本正常工作.
如何选择一个或多个(或所有)行并将所选行(包括所有列)发送到 servlet?
【问题讨论】:
标签: javascript java jquery servlets