title: Adding a loading image to a jquery ajax post
body: <p>i have the following javascript to post a form through ajax without refreshing the screen.  Since the post take a little while, i wanted to add a loading image during processing.  </p>
  
  <p>I see <a href="http://www.electrictoolbox.com/load-content-jquery-ajax-loading-image/" rel="nofollow noreferrer">this article</a> but it seems to only list .load() or .get() but not $.post.  </p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      $(document).ready(function() {
          $('#contact form').live('submit', function() {
  
              $.post($(this).attr('action'), $(this).serialize(), function(data) {
  
                  $("#contact").replaceWith($(data));
  
              });
              return false;
          });
      });
  &lt;/script&gt;
  </code></pre>