I use this jquery code to send request to server and get back response from server. Here I am updating a table with this response data. This process is working perfectly.
My problem is I need to display some message according to the behavior of the script. That mean I need to display a message something similar to 'Loading, Please wait a few seconds' when table is update. And after update the table I need to display a message something like this 'Hurray, you have successfully updated the user table.'
Can anyone tell me how I accomplish this with jquery?
This is my code sofar :
$.ajax({
type: "POST",
url: "process.php",
dataType: 'html',
data: {
name: $('#name').val(),
address: $('#address').val(),
city: $('#city').val()
},
success:function(data){
$('#manage_user table > tbody:last').find('tr:first').before(data);
},
error:function (xhr, ajaxOptions, thrownError){
alert(thrownError);
},
complete: function(){
//alert('update success');
}
});
Thank you.