title: How can you stop user input actions while an AJAX query in requesting data?
body: <p>I have a <code>JQUERY</code> function that uses <code>AJAX</code> via a <code>PHP</code> page, when the AJAX is running I have a loading.gif show for the user. When the <code>AJAX</code> returns the json data that was requested all is fine. What I would like to do would be to make any user input null while this is happening.</p>
  
  <p>What would be the best way to go about this?</p>
  
  <p>EDIT:</p>
  
  <p>I ended up using...</p>
  
  <pre><code>$('#loadingDiv')
      .hide()  // hide it initially
      .ajaxStart(function() {
          $(this).show();
      })
      .ajaxStop(function() {
          $(this).hide();
      })
  ;
  </code></pre>
  
  <p>From the post <a href="https://stackoverflow.com/questions/68485/how-to-show-loading-spinner-in-jquery">How to show loading spinner in jQuery?</a></p>
  
  <p>Thanks for the suggestions!</p>