“Excluir dados com Ajax no PHP” Respostas de código

Excluir dados com Ajax no PHP

function del() 
{
	$(document).delegate(".btn-delete-employee", "click", function() {

		if (confirm("Are you sure you want to delete this record?")) {
		    var employeeId = $(this).attr('data-id'); //get the employee ID

		    // Ajax config
			$.ajax({
		        type: "GET", //we are using GET method to get data from server side
		        url: 'delete.php', // get the route value
		        data: {employee_id:employeeId}, //set data
		        beforeSend: function () {//We add this before send to disable the button once we submit it so that we prevent the multiple click
		            
		        },
		        success: function (response) {//once the request successfully process to the server side it will return result here
		            // Reload lists of employees
	            	all();

		            alert(response)
		        }
		    });
		}
	});
}
BeAcoder

Exclua registro sem uma página Atualizar com Ajax no PHP

<tr data-image-id="<?php echo $r1['photo_id']; ?>">
After deleting data, run this cammand:
$("tr[data-image-id="+del_id+"]").remove();
Gneiss183

Respostas semelhantes a “Excluir dados com Ajax no PHP”

Perguntas semelhantes a “Excluir dados com Ajax no PHP”

Mais respostas relacionadas para “Excluir dados com Ajax no PHP” em PHP

Procure respostas de código populares por idioma

Procurar outros idiomas de código