Rather complex scenario here... I'm using several images rotating based on time of day. The images display fine.
<script language="JavaScript">
var layout = new Array;
layout[0] = "http://www.blabla.gif";
layout[1] = "http://wwwblabla.gif";
var digital = new Date();
var l = digital.getHours(24) % layout.length;
document.write("<img src=" + layout[l] + ">");
As only one image will display at any given time, I want to count the number of times each particular image is loaded.
<script language="JavaScript">
var advertisers = new Array;
advertisers[0] = "http://blabla/statistics/stat.php?id=blabla";
advertisers[1] = "http://blabla/statistics/stat.php?id=blabla";
var digital = new Date();
var l = digital.getHours(24) % advertisers.length;
var adhit = advertisers[l];
</script>
<img scr= "adhit" width="1" height="1">
If I use document.write(... to load the link to the stat counter for the image loaded, I get the blue ? icon on the page 'cos in fact there is no image, but the counter increments fine.
When I use <img src= with or without the " of the variable name and with or without the height and width, I cannot get the stat counter to increment the hit.
Any suggestions on either getting rid of the ? icon or getting the <img src to work ???
Thanks in advance.