Show a loading GIF BeforeUnload Of a Page
<p>I am working on a application which will work on computer as well as Ipad,Iphone,Tablets and Android phones. I have one requirement of Showing a loading... gif when user moves from one page to other because this will give user a info that page loading/unloading is in process.</p>

<p>So i Tried below mentioned code 
///below code for showing GIF while DOM is not ready.</p>

<pre><code>$(document).ready(function(){
  $("#loading").hide();});
</code></pre>

<p>//below code for showing GIF when user clicks on some button to do some Server Interaction.</p>

<pre><code>$(window).bind('beforeunload',function(){ 
      $("#loading").show();});
</code></pre>

<p>where #loading is id of a div which contains my GIF Code.
Now this is working greatly on PC browsers but NOT on Ipad,Iphone and android phones. I am Not able to figure out why.</p>

<pre><code>&lt;div id="loading"&gt;
  &lt;img id="loading-image" src="/img/loading.gif" alt="Loading..." /&gt;&lt;/div&gt;
</code></pre>

<p>This div is for loading the GIF.</p>
