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

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -