title: Display Ajax loader before load data
body: <p>Hello friends i want to show Ajax loader before Data load in particular div but problem is the data is coming dynamically on same page but my script calling data from another file  <code>Script.php</code> please see  my code below</p>
  
  <p><strong>Script</strong></p>
  
  <pre><code>&lt;script&gt;
  function loadingAjax(div_id)
  {
      $("#"+div_id).html('&lt;img src="ajax-loader.gif"&gt; saving...');
      $.ajax({
          type: "POST",
          url: "script.php",
          data: "name=John&amp;id=28",
          success: function(msg){
              $("#"+div_id).html(msg);
          }
      });
  }
  &lt;/script&gt; 
  </code></pre>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;body onload="loadingAjax('myDiv');"&gt;
  
  
  &lt;div id="myDiv"&gt;&lt;/div&gt;
  
  &lt;div id="xyz"&gt;&lt;img src="ss/image/abc.jpg" /&gt;&lt;/div&gt;
  
  
  &lt;/body&gt;
  </code></pre>
  
  <p>Its working fine but i want to load data in same page please help me </p>
  
  <p>Thanks in advance ....</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I want to show loader before load data <code>#xyz</code> into <code>#myDiv</code></p>