I have made a jquery function which will change status to complete if pending .
The function is executing properly on first button click and it is loading my table changing my status to complete.
But on second time on button click it is not reading the function.
Here is my jquery code:
$('a.success_btn').click(function(e){
e.preventDefault();
var id = $(this).attr('id');
var status = "completed";
$.ajax({
type: "POST",
url: "includes/vorder.php",
data:{ o_id: id, o_status: status },
success: function(data){
alert(data);
$('#all_order').load('orders.php #all_order');
}
})
});
Here:
a.success_btn = button class name
'#all_order'= my order table div id
The table is on another php page means '#all_order' and it has been included to this page.
