How to load inline script after JQuery and JQuery UI?
<p>I have several inline <code>&lt;script&gt;</code> tags that appear in the middle of my HTML document. These all require Jquery, and a couple need JQuery UI.</p>

<p>JQuery and JQuery UI are linked at the bottom of the document.</p>

<p>How can I have the inline scripts run after JQuery and UI are ready.</p>

<p>I have tried wrapping the inline scripts with this with no success:</p>

<pre><code>$(window).load(function() {
//
 });
</code></pre>

<p>And I have also tried darbio's answer <a href="https://stackoverflow.com/questions/7486309/how-to-make-script-execution-wait-until-jquery-is-loaded/17914854#17914854">here</a> using:</p>

<pre><code>function defer(method) {
    if (window.jQuery)
        method();
    else
        setTimeout(function() { defer(method) }, 50);
}
defer(function () {
    alert("jQuery is now loaded");
});
</code></pre>

<p>But this didn't seem to work either?</p>