Only one AJAX request at a time?
<p>I would like to make sure there is only one AJAX request going on (for a user) at a time. This is what I tried:</p>

<pre><code>var ajaxFinished = 1;

$('#selector').keyup(function() {

    if (ajaxFinished == 1) {

        ajaxFinished = 0;

        $.get('test.php', { par : "par" }, function(data) {

            // do stuff with data
            ajaxFinished = 1;

        });
    }

});
</code></pre>

<p>But the problem is the AJAX request gets executed only once now even though I activate the event multiple times.</p>
