Loading message and setTimeout
<p>I have the following script:</p>

<pre><code>$(function() {
    $(".message").hide();

    function simulate_ajax_call()
    {
        $.ajax({
            url: "/echo/json/",
            success: function(){
                alert("done");
                $(".message").empty().html("done");
                $(".message").delay(1000).fadeOut(500);
            }
        });
    }

    $('.button').click(function() {
        $(".message").fadeIn(500);
        setTimeout("simulate_ajax_call()", 5000);
    });
});
</code></pre>

<p>With the following HTML:</p>

<pre><code>&lt;input type="button" value="button" class="button" /&gt;
&lt;div class="message"&gt;loading...&lt;/div&gt;
</code></pre>

<p>For some reason the <code>setTimeout</code> part is not working.  i.e. it does not seem to call the function after 5000ms.</p>

<p><a href="http://jsfiddle.net/oshirowanen/kHEVa/" rel="nofollow">jsFiddle</a>.</p>
