title: Disable Button while AJAX Request
body: <p>I'm trying to disable a button after it's clicked. I have tried:</p>
  
  <pre><code>$("#ajaxStart").click(function() {
      $("#ajaxStart").attr("disabled", true);
      $.ajax({
        url: 'http://localhost:8080/jQueryTest/test.json',
        data: {
          action: 'viewRekonInfo'
        },
        type: 'post',
        success: function(response){
          //success process here                             
          $("#alertContainer").delay(1000).fadeOut(800);
         },
        error: errorhandler,
        dataType: 'json'
      });    
      $("#ajaxStart").attr("disabled", false);
  });
  </code></pre>
  
  <p>but the button is not getting disabled. When I remove <code>$("#ajaxStart").attr("disabled", false);</code>    the button gets disabled. </p>
  
  <p>While this is not working as expected, I think the code sequence is correct. Any help will be appreciated.</p>