Javascript delayed load of content within div element
<p>I have some code which delays the general page load of my website, which is included at the very top of the page (adverts to be specific, with tracker scripts which sometimes are slow to fully load.)
These ads loading slowly delay other JS scripts/effects/functions from working until they finish.. e.g. scrollers/sliders etc etc</p>

<p>What i was wondering, is what is the code to load content into these specific div elements maybe after the page is loaded?? (EDIT: Changed to just ask when the rest of page is loaded, to ammend to comments below)</p>

<p>(Ive seen similar samples of code to this.. but never quite got it to function right)</p>

<p>this is the original code</p>

<pre><code>&lt;div id="ad-header"&gt;&lt;script type='text/javascript' src='http://url.com'&gt;&lt;/script&gt;
</code></pre>

<p></p>

<p>then tried changing to, and changes i keep making are unsuccessful at making it work. needs to load the ad into the ad-header id spot</p>

<pre><code>var delay = 3000;
setTimeout(
    function()
    {
        var oScript;
        oScript = document.createElement("script");
        oScript.type = "text/javascript";
        oScript.src = "http://url.com";
        document.body.appendChild(oScript);
    },
    delay
);
</code></pre>
