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

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -