I want to delete a row of Mysql through a link, this way I get very good <a href='eliminar.php/?dato_eliminar=
but the page is reloaded. Is there any way to do it with AJAX and the% tag <a>
or the label <button>
?
Here is the code that generates the delete buttons for each MYSQL record:
$.getJSON('cargar_materiales.php', {param1: 'value1'}, function(json, textStatus) {
$.each(json, function(index, val) {
$(".tabla_materiales").append("<tr>"+"<td>"+val.id+"</td>"+"<td>"+val.nombre+"</td>"+"<td>"+val.codigo+"</td>" +"<td>"+val.precio+"</td>" +"<td>"+val.descripcion+"</td>" +"<td>"+ "<a href='eliminar.php/?dato_eliminar=" + val.codigo +"'>Eliminar</a>" +"</td>" + "</tr>")
});
});
});