JellyON said the following on 11/6/2005 5:34 AM:[color=blue]
> Hi. Is there a way to delay a call to a page counter (ie. call to a
> server script from an IMG tag) for the purpose to not lock the page
> loading awaiting counter be displayed.[/color]
Display a transparent image temporarily. Use the window.onload (or body
onload) to trigger a function that will change the images src attribute
accordingly.
[color=blue]
> Maybe a setTimeout() launching an equivalent of "document.write", but
> writing in a specific DIV ? Thanks in advance for your ideas.
>
> Actually, the counter is called (without delay) like this :
>
> <div id="count" style="position: absolute; visibility: visible; top:
> 20px; left: 20px; width: auto; height: auto; z-index: 5; cursor:
> default"><img src="http://host.com/cgi-bin/counter.exe?color=red&font=
> 6"></div>[/color]
<img src="http://yourDomain.com/transparent.gif" name="counterImage"
width="##" height="##">
along with this script:
function changeCounterImage(){
document.images['counterImage'].src="http://host.com/cgi-bin/counter.exe?color=red&font=6";
}
window.onload = changeCounterImage;
--
Randy
comp.lang.javascript FAQ -
http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices -
http://www.JavascriptToolbox.com/bestpractices/