If you were to follow the mootools example exactly as they have it, the javascript code would simply need to be changed to this to work (basically the same way) in 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');
}
});
});