title: How do I make an image until it is finished loading, AJAX jQuery
body: <p>I want to make an image showing that the download process underway to complete bringing Page (2014.php) Such as wait.gif:</p>
  
  <p>my example code is not working!!!! i need to make waiting image until page load... my page(2014.php) take a few minutes in this minutes i need make waiting image </p>
  
  <pre><code>$('#data').load('test.php');
  </code></pre>
  
  <p>example:</p>
  
  <pre><code>&lt;button&gt;Click&lt;/button&gt;
  &lt;div id="data"&gt;&lt;/div&gt;
  
  &lt;script&gt;
  $(document).ready(function(){
   $('button').click(function(){
    $('#data').html('&lt;img src="wait.gif" /&gt;');
    jQuery.ajax({
     url: "2014.php",
     success:function(data){$('#data').html(data);}
    });
   });
  });
  &lt;/script&gt;
  </code></pre>