Jquery load and then edit loaded content
<p>I am using Jquery load and then as soon as the content is loaded into the div I want to change some of the tags to language dependent variables.</p>

<p>My problem is that I am having to use a settimeout to get the script to wait long enough for the elements to be ready to edit.</p>

<p>When I use the callback function parameter the elements I want to edit apparently aren't ready because they don't get set.  I hate to use settimeout because this limits everyone to the slowest setting and invariably some connections will be even slower than that.</p>

<p>Apparently the callback method just means that the ajax method got the html back but it doesn't ensure that the imported elements are actually ready in the dom.</p>

<p>Anyone have ideas?</p>

<p>current code</p>

<pre><code>$("#content-basket").load("/BasketPage.htm?time=" + now.getMilliseconds());
...
...
setTimeout("timedbasket();", 500);
...
...
function timedbasket() {
    alert($('#basketlegend'));
    $('#basketlegend').html(basketlabel);
}
</code></pre>

<p>I would like to be able to use </p>

<pre><code>$("#content-basket").load("/BasketPage.htm?time=" + now.getMilliseconds(), "", timedbasket());
</code></pre>

<p>Here is the basket.htm source</p>

<pre><code>&lt;tr&gt;
    &lt;td&gt;
        &lt;div id="basket"&gt;
            &lt;fieldset&gt;
                &lt;legend&gt;&lt;span id="basketlegend"&gt;&lt;/span&gt;&lt;/legend&gt;
                &lt;table id="baskettbl" border="0" class="basket-table"&gt;
                    &lt;tbody&gt;
                        &lt;tr class='total'&gt;
                            &lt;td&gt;
                                &lt;span id="empty"&gt;&lt;/span&gt;
                            &lt;/td&gt;
                        &lt;/tr&gt;
                    &lt;/tbody&gt;
                &lt;/table&gt;
            &lt;/fieldset&gt;
        &lt;/div&gt;
    &lt;/td&gt;
&lt;/tr&gt;
</code></pre>
