Advert delivery via Javascript document.write
<p>I'm building an advert delivery method and am try to do it through an external Javascript/jQuery page.</p>

<p>I have this so far, but I have some issues with it</p>

<pre><code>$.get('http://url.com/ad.php', {
    f_id: _f_id,
    f_height: _f_height,
    veloxads_width: _f_width
}, function (result) {
    var parts = result.split(",");
    var path = parts[0],
        url = parts[1];
    document.write('&lt;a href="' + url + '" target="blank"&gt;&lt;img src="' + path + '"&gt;&lt;/a&gt;');
</code></pre>

<p>I can see the page load, but then after the code above is loaded, it creates a new page with just the advert on it. Is there anyway I can write it onto the page where the code was put?</p>

<p>And this is the script web masters put on their websites to include the adverts:</p>

<pre><code>&lt;script type="text/javascript"&gt;

var _f_id = "VA-SQ2TDEXO78N0";

var _f_width = 728;

var _f_height = 90;

&lt;/script&gt;
&lt;script type="text/javascript" src="http://website.com/cdn/addelivery.js"&gt;&lt;/script&gt;
</code></pre>

<p>Cheers  </p>
