Hello. I implemented the following code to delete data from the database via Ajax:
$(".delalbumimg").on("click", function(){ var res = confirm("ΠΠΎΠ΄ΡΠ²Π΅ΡΠ΄ΠΈΡΠ΅ ΡΠ΄Π°Π»Π΅Π½ΠΈΠ΅"); if(!res) return false; var img = $(this).attr("alt"); //ΠΈΠΌΡ ΠΊΠ°ΡΡΠΈΠ½ΠΊΠΈ var rel = $(this).attr("rel"); //ΡΠ»Π°Π³ ΠΊΠ°ΡΡΠΈΠ½ΠΊΠΈ(0-Π±Π°Π·ΠΎΠ²Π°Ρ, 1-Π³Π°Π»Π»Π΅ΡΠ΅Ρ) var album_id = $("#album_id").text(); //ID Π°Π²ΡΠΎΡΠ° $.ajax({ url: "./", type: "POST", data:{album_image: img, rel: rel, album_id: album_id}, success: function(res){ $(this).closest("tr").remove(); alert(this); }, error: function(){ alert("ΠΡΠΈΠ±ΠΊΠ°"); } }); });
If successful, I need to delete the line (as a rule, without reloading the page) that contained the deleted photo. How to implement it?