I have an external script which loads advertisements. The script being loaded includes calls to document.write
. The problem is this delays the doc ready for the site. I would like to delay showing this until after the doc ready.
Currently I just tried wrapping the function that loads the external content in a jquery doc ready, but the page blows up. It goes to a all white screen with just the ad and some code showing.
Obviously this is because document.write is running after the page is loaded. Does anyone know a way around this or how to delay loading of the external content till after doc ready?
You could try the hack where you override document.write and buffer the output, then write it to a div in doc ready.