I have searched through StackOverflow and have seen various topics on how to do this, but nothing that really pertains to my particular situation. I am writing (for a class)
try to set up ajaxSetup to do a request every n milliseconds (i put 1000 here) and check if it times out and then disable button.
$.ajaxSetup({
timeout: 1000,
error: function(request, status, maybe_an_exception_object) {
if(status != 'timeout')
//Code to enable button
else
//Code to disable button
}
});