To enhance user experience, move up my content and improve chances of my page fully loading, I want to defer the actual loading of an adsense block to the end of the document. To achieve this, I use the following construct: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="nl" xml:lang="nl"> <head> <title>Dynamic adsense test</title> <script type="text/javascript"><!-- function placeads() { var string = new Array(); var string2 = new Array(); string.push('<!--'); string.push('google_ad_client = \"pub-inseryourcodehere\";'); string.push('/* Blah blah */'); string.push('google_ad_slot = "adslotnumber";'); string.push('google_ad_width = 336;'); string.push('google_ad_height = 280;'); string.push('//-->'); var writestring = string.join('\n'); var adsDiv = document.getElementById('adsense_here'); adScript1 = document.createElement("script"); adScript1.type="text/javascript"; adScript1.text=writestring; adsDiv.appendChild(adScript1); adScript2 = document.createElement("script"); adScript2.type="text/javascript"; adScript2.src="http://pagead2.googlesyndication.com/pagead/show_ads.js"; adsDiv.appendChild(adScript2); alert(google_ad_slot); } //--> </script> </head> <body onload="placeads()"> <div id="adsense_here" style="width: 500px; height:500px;"></div> </body> </html> Code (markup): If you load this page into your browser (I'm using FF3.5.5), you'll see in the DOM explorer that all of the adsense scripts were properly added to the document tree. Also, in the alert box you'll see that at least the first script *did* get evaluated, since the variable "google_ad_slot" does have a value. However, the ads simply don't appear... Can anybody help me? Why is it that the second script simply won't evaluate?