0
Good afternoon,
I’ve been having a problem for a few days trying and I can’t seem to fix it,
I am trying to make an editable table, the problem is that after I copy the table with json I can’t do anything with the <td>
, everything I put on "append
" is not recognized after.
$("button[name='visualizar']").on('click', function() {
var i = 0;
$("#tabela").empty();
$.ajax({
type: "post",
dataType: "json",
url: "php/select_db.php",
success: function(dados) {
for (i = 0; dados.length > i; i++) {
$("#tabela").append("<tr><td>" + dados[i].modulo + "</td><td>" + dados[i].codigo + "</td></tr>");
}
},
error: function() {
alert("fail");
}
//$("#aviso2").toggle('slow');
});
});
so far all beauty//
the above code inserts the data into the table, but these cells that are inserted via jquery are not recognized later.
if I use $("#tabela tbody tr td").dblclick(function()}
; nothing happens.
Now if I create a test table directly on the front the function recognizes the table and executes the code that is inside the function. If anyone can help me, I’ve done a lot of research and haven’t found what’s causing this problem. Thank you very much.
at the beginning of the javascript document you are using the
$(document).ready(function(){})
?– William