jquery - Hide sensitive data in html table column -
i have html table , first column has id. column hidden. have read bad approach.
but need hidden id when user selects row , click delete button ajax post id.
where else should put id per row differently , why approach bad?
add id attribute in table rows. this:
<tr data-id="1"> <td><span class="delete">delete</span></td> </tr> <tr data-id="2"> <td><span class="delete">delete</span></td> </tr>
and when user click on delete or edit, jquery.
$('.delete').bind('click', function (e) { var $row = $(this).closest('tr'); var id = $row.attr('data-id'); // have `id` });
Comments
Post a Comment