I am using Jquery AJAX to post a form on my page. I want to hide a div whilst AJAX is being performed and show it again when AJAX is a success.
How can I do this?? Check my code here:
$(document).ready(function(){
$("form#microblogpost").submit(function() {
// we want to store the values from the form input box, then send via ajax below
var postmessage = $('#message1').attr('value');
var from_user = $('#from_user').attr('value');
var from_username = $('#from_username').attr('value');
$.ajax({
type: "POST",
url: "process.php",
data: "postmessage="+ postmessage +"& from_user="+ from_user +"& from_username="+ from_username,
success: function(){
}
});
return false;
});
});