Если бы вы следовали примеру mootools именно так, как он есть, код javascript просто нужно было бы изменить на этот, чтобы он работал (в основном так же) в jQuery:
$(function() {
//make the ajax call to the database to save the update
$.ajax({
url: '<?php echo $_SERVER['PHP_SELF']; ?>',
method: 'POST',
beforeSend: function() {
$('submit').attr('disabled','disabled');
},
complete: function(xhr,status) {
$('submit').disabled = 0;
$('#message').removeClass('success').removeClass('failure');
$('#message').fadeIn(3000);
},
success: function(data,status) {
//update message
$('#message').text('Status updated!').addClass('success').fadeIn('medium');
//store value, clear out box
var status = $('#status').val();
$('#status').val('');
//add new status to the statuses container
var element = $('<div class="status-box">');
element.html(status + '<br /><span class="time">A moment ago</span>');
$('#statuses').prepend(element);
//place the cursor in the text area
$('#status').focus();
},
error: function(xhr, status, error) {
//update message
$('#message').text('Status could not be updated. Try again.').addClass('failure').fadeIn('medium');
}
});
});