I have taken time to review many of the discussions on this topic but have not found an answer to my question.
In my site I am trying to optimize my page load speed and one of the ways I would like to do that is to move the my ad scripts to the bottom of the page to allow my content to load first. I still want the ad to show up in the middle of the page.
the ad code currently is in a script block in the middle of the page and looks something like this
<div id="topAd">
<script>
document.write('<s' + 'cript lang' + 'uage="jav' + 'ascript" src="' + src + '"></' + 'scr' + 'ipt>');
</script>
</div>
what I would like to do is something like this at the bottom of the page
<script>
var script = document.createElement('script');
script.src = src;
jQuery('#topAd').append(script);
</script>
Unfortunately this always loads the content at the bottom of the page and not inside the "topAd" div. Can anyone explain why this is happening?