 <p><code>jQuery.Deferred</code> objects provide a very elegant way to do this (I know you're not using jQuery 1.5: I'm just giving you a reason to upgrade <code>;-)</code>:</p> <p>Assuming we have two scripts co-operating like the following:</p> <pre><code>// defines utilities var util = util || { loaded: $.Deferred() }; (function(){ $.extend(util, { msg: "Hello!" }); util.loaded.resolve(); })(); </code></pre> <p>... and:</p> <pre><code>// uses them var util = util || { loaded: $.Deferred() }; util.loaded.then(function(){ alert(util.msg); }); </code></pre> <p>... the alert will always fire after the first script has had a chance to define it's utilities no matter the order they load in. This has advantages over the <code>setTimeout</code> and event based approaches in that it's easier to have multiple dependencies (using <code>$.when</code>), doesn't use polling, and you don't have to worry about handling the order-of-loading explicitly.</p> <p>The only thing that's kind of gross is that all of the modules have to include:</p> <pre><code>var util = util || { loaded: $.Deferred() }; </code></pre> <p>... and <code>$.extend()</code> it to make sure that they use the same deferred. </p>