Showing a loading image when a function is being called
<p>Im trying to show a loading image whilst a javascript function runs. Its crunching a lot of numbers and on slower pc's it can take a few seconds to run.</p>

<p>I thought this would work</p>

<pre><code>function myFunction(){;
    $('#loading').show();
    // The bit that takes ages to run
    $('#loading').hide();
}
</code></pre>

<p>However it doesn't seam to unhide the #loading div. </p>

<p>Is there a better way to do this?</p>
