I am working on html table rows (which is two at this moment) as shown below in which on button click:
=> JS/jQuery
Try changing this:
$.ajax({
url: 'convert.php',
type: 'POST',
data: {id: target}, //change to what you want
success: function(res)
{
},
error: function(res)
{
}
})
To this:
$.ajax({
url: 'convert.php',
type: 'POST',
data: {id: target}, //change to what you want
success: function(res)
{
//You can add $(".go-btn").html('completed'); to here, but I prefer the other way.
},
error: function(res)
{
// This is unnecessary if you are not gonna make it do anything if error occurs.
}
})
.done(function(data) {
$('.go-btn').html('Completed!');
//This fires when AJAX call suceeds the process. As a side note, "data" is what your .php code outputs, so you can do whatever you want to do with it.
});
And also see my comments. I hope this helps.