Disable the button on the OnClick event, then re-enable on the AJAX callback event handler. Here is how I do it with jQuery.
<script>
$(document).ready(function() {
$('#buttonId').click(function() {
$(this).attr('disabled', 'disabled');
callAjax();
});
});
function callAjax()
{
$.ajax({
url: 'ajax/test.html',
success: function(data) {
//enable button
$('#buttonId').removeAttr('disabled');
}
});
}
</script>