How to run code after the last post has completed?
<p>I have the following code:</p>

<pre><code>for (var i = 0; i &lt; numFiles; i++) {
    $.post('/Secure/File/PhysicalFileHandler.ashx?custId=whatever&amp;idx=' + i, function (data) {
        ids += data + '|';
        if (i == numFiles-1) {
            ids = ids.substring(0, ids.length - 1);
        }
    });

}
</code></pre>

<p>How could I execute a chunk of code after the last post has finished?  The method I was trying above does not work (<code>i</code> is <code>==</code> to <code>numFiles</code> already when it gets there).  Suggestions?</p>
