Forum Moderators: open

Message Too Old, No Replies

innerHTML

Replacing content to optimize page load time

         

klauslovgreen

1:05 pm on Aug 28, 2005 (gmt 0)

10+ Year Member



Hi,

I am facing a bit of a strange problem. I am setting up an adsever and to make sure the page loads quickly regardles how long the ads are taking (if ever) I am using empty

<div id="oas-Top"></div>

and then replace the content end of the page as follows:


<script type="text/javascript"><!--
// returns AD content to visible
function showAdvert(pos) {
document.getElementById("oas-"+pos).innerHTML = document.getElementById("oas-"+pos+"-parent").innerHTML;
}
//--></script>


<div id="oas-Top-parent" style="display:none"><script type="text/javascript">
<!--
OAS_AD('Top');
//-->
</script>


<script type="text/javascript"><!--
showAdvert("Top");
//-->
</script>

It works most of the time (always in FireFox) but some complex JS code served by the adsystem get IE to stop loading. Any thoughts or ideas are welcomed.

Cheers
Klaus

thesheep

11:04 am on Aug 29, 2005 (gmt 0)

10+ Year Member



Just an idea but I've found that IE can have problems with script files placed within <div> elements. Sometimes putting them further down just before the closing </body> tag helps.