Dette fungerer fint, men laver man det 2 gange går det ikke
hvorfor ??
og hvis det kan bruges 2 gange hvilke variabler skal da ændres.
mvh Johnny
<script language="JavaScript">
<!--
function adArray() {
for (i=0; i*2<adArray.arguments.length; i++) {
this[i] = new Object();
this[i].src = adArray.arguments[i*2];
this[i].href = adArray.arguments[i*2+1];
}
this.length = i;
}
function getAdNum() {
dat = new Date();
dat = (dat.getTime()+"").charAt(8);
if (dat.length == 1)
ad_num = dat%ads.length;
else
ad_num = 0;
return ad_num;
}
// ****** YOU NEED NOT MODIFY ANYTHING THAT IS NOT IN BETWEEN THESE TWO COMMENTS ****
// image,url
var ads = new adArray(
"banner/teenziteaabner470x60.gif",
http://www.teenzite.htm",
"banner/fest.gif","
http://www.fest.dk",
"banner/suppebanner.jpg",
http://www.suppe.dk
)
var ad_num = getAdNum(); // don't change this line
document.write('<CENTER><TABLE CELLPADDING=0 CELLSPACING=1 BORDER=0><TR><TD ALIGN=CENTER>'
+'<A HREF="'+ads[ad_num].href+'" target="blank"><IMG SRC="'+ads[ad_num].src+'" '
+'HEIGHT=60 WIDTH=468 BORDER=0 name=js_ad></A></TD></TR></TABLE></CENTER>');
// ****** YOU NEED NOT MODIFY ANYTHING THAT IS NOT IN BETWEEN THESE TWO COMMENTS ****
link_num = document.links.length-1;
function rotateSponsor() {
if (document.images) {
ad_num = (ad_num+1)%ads.length;
document.js_ad.src = ads[ad_num].src;
document.links[link_num].href = ads[ad_num].href;
setTimeout("rotateSponsor()",18000);
}
}
setTimeout("rotateSponsor()",18000);
// -->
</script>