Detect and append jQuery if not loaded with pure Javascript and a fallback
<p>Does anybody know a way to detect if the jQuery library was loaded and if not append it and start a script as a fallback solution after it's loaded to the DOM?</p>

<p>Here's my script:</p>

<pre><code>if (typeof jQuery == 'undefined') {
    // if jQuery Library is not loaded
    var script = document.createElement( 'script' );
    script.type = 'text/javascript';
    script.src = 'http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js';
    document.body.appendChild(script);
    startScript();
} else {
    // cool, jQuery Library is loaded
    startScript();
}

function startScript() {
    $.noConflict();
    jQuery(document).ready(function($){
    .... // my jquery code
    });
}
</code></pre>

<p>Of course, above appends jQuery correctly but doesn't do anything because the script starts immidiately after appending. Any hint on this?</p>

<p>I appreciate any answer. Thanks!</p>
