Reputation: 1697
I use this code for sending form to the server with $.post()
function.
$.post('filepath' , {fname:fname , lname:lname} ).done(function(data){
$('#status').html('finished');
});
I want show the user a messege while sending the data to the server.done()
is for finished progress. is there any way for while sending the data??
Upvotes: 0
Views: 45
Reputation: 5235
You can try
$('#status').html('Processing...');
$.post('filepath' , {fname:fname , lname:lname} ).done(function(data){
$('#status').html('finished');
});
Edit:
$(document).on("ajaxStart", function(){
$("#status").html('Processing...');
});
Find more on http://api.jquery.com/Ajax_Events/
Upvotes: 2