image preloader in jquery
<p>i have this code but i dont know what to do next.. </p>

<pre><code>var toBeInsertedToAS = "";

for(j=1;j&lt;=10;j++)
{
    $('&lt;img /&gt;')
    .attr('src','imgUrl_'+j+'.png')
    .load(function(){                
        toBeInsertedToAS += $(this).attr('src')+"|";                          
    });
    theSetDataCount++;
}    
alert(toBeInsertedToAS);
</code></pre>

<p>i just want to have this output..</p>

<blockquote>
  <p>imgUrl_1.png|imgUrl_2.png|imgUrl_3.png|etc...</p>
</blockquote>

<p>but as what i can see, after the loop, there's no output.. maybe because it goes to alert(toBeInsertedToAS) without loading the pictures completely.. i just want to completely load the pictures first before it will execute the alert..</p>
