title: Ajax loading GIF not working
body: <p>I have a HTML form that calls a JS function to validate fields. This JS function returns false if there are any errors, otherwise returns true and adds a loading GIF to a proper DIV. </p>
  
  <p>The problem is the loading GIF never appears in the browser. It just shows a blank space. The GIF path is correct. It only works if my validation function returns false instead of true after the loading GIF is added.</p>
  
  <p>Here is an example of how my code looks like :</p>
  
  <pre><code>function validate()
  {
    if (document.getElementById('email').value === '')
    {
      alert('Please enter your email');
      return false;
    } else {
      $('#loading_div').html('&lt;img src="images/info-loading.gif" /&gt;');
      return true;
    }
  }
  </code></pre>
  
  <p>Actual function is more complex, but the logic is just like this above. </p>
  
  <p>Thanks !</p>