title: Perform action on browser stop button click
body: <p>Apologies if this is simplistic; I am new to JQuery.  I have searched and found questions like <a href="https://stackoverflow.com/questions/11220581/jquery-browsers-stop-button-event">this</a>, but they don't seem to quite answer my question.</p>
  
  <p>I am using JQuery to show a dumb progress indicator for actions that take a long time:</p>
  
  <pre><code>$(document).ready(function() {
      $('form').submit(function() {
          $('#progress').show();
      });
  });
  </code></pre>
  
  <p>When the user clicks a form button, I just show a div with an animated gif.  This div is visible for the rest of the time the page is visible.  After the form's action is complete, a new page loads.</p>
  
  <p>This works well, but what if the user clicks "stop" in the browser before the action completes?  How can I make the div disappear?  Is there a way to catch this event, or is there a better way to handle the whole situation?</p>
  
  <p>Thanks for your help.</p>