title: Display loading image while post with ajax
body: <p>I know there are thousands of examples on the internet, but I want for the script I already have to display a loading gif image while the data is retrievedd. My java knowledge are poor, therefore I'm asking how to change the following:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt; 
   $(document).ready(function(){
    function getData(p){
      var page=p;
      $.ajax({
          url: "loadData.php?id=&lt;? echo $id; ?&gt;",
          type: "POST",
          cache: false,
          data: "&amp;page="+ page,
          success : function(html){
              $(".content").html(html);
          }
      });
  }
  getData(1);
  
  $(".page").live("click", function(){
      var id = $(this).attr("class");
      getData(id.substr(8));
          });
        });
    &lt;/script&gt; 
  </code></pre>
  
  <p>And my div is here:</p>
  
  <pre><code>    &lt;div class="content" id="data"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>Thanks.
  John</p>