title: Show loading GIF in jQuery without AJAX?
body: <p>I know how to do this with </p>
  
  <pre><code>$(gif).show(); 
  $.post( action, data, function(result) { $(gif).hide(); } );
  
  // using ajaxStart and ajaxStop is a better way too
  </code></pre>
  
  <p>But, I don't know how to do it without using post, I tryed</p>
  
  <pre><code>$(gif).show();
  doAction();    // No post...
  $(gif).hide();
  </code></pre>
  
  <p>The problem is, while doAction function is running the $(gif) isn't visible .... <strong>I tryed with timeouts too</strong>, but the problem is that ends before or after depending of the doAction() duration...</p>