Timing issue with jQuery and $(document).ready()
<p>I have the following code block code when the document is ready:</p>

<pre><code>$(document).ready(function() {
    createDivs(); // creates some divs with class 'foo';

    // iterate
    $(".foo").each(function(index) {
        alert(index + " - " + $(this).text());
    });
}
</code></pre>

<p>I find that the "iterate" part misses the divs I created in the createDivs() method entirely! Is there some timing issue I'm not aware of? Why doesn't jquery see the divs that were just created?</p>
