View Full Version : Random Image problem


PrincessSammy
02-10-2003, 05:24 PM
Hi,

I'm having a very hard time getting this script to work. This is a borrowed script so please don't yell at me for using it. Its from a generator.


<script language="JavaScript">
<!-- Begin
var ad_cnt1 = 10;
var now1 = new Date()
var sec1 = now1.getSeconds()
var ad1 = sec1 % ad_cnt1;
ad1 +=1;
if (ad1==1) {
url1="/images1.gif";
banner1="/images1.gif/";
width1="300";
height1="85";
}
if (ad1==2) {
url1="/images/1.gif";
banner1="/images/1.gif";
width1="300";
height1="85";
}
if (ad1==3) {
url1="/images/1.gif";
banner1="/images/1.gif";
width1="300";
height1="85";
}
if (ad1==4) {
url1="/images/1.gif";
banner1="/images/1.gif";
width1="300";
height1="85";
}
if (ad1==5) {
url1="/images/1.gif";
banner1="/images/1.gif";
width1="300";
height1="85";
}
if (ad1==6) {
url1="/images/1.gif";
banner1="/images/1.gif";
width1="300";
height1="85";
}
if (ad1==7) {
url1="/images/1.gif";
banner1="/images/1.gif";
width1="300";
height1="85";
}
if (ad1==8) {
url1="/images/1.gif";
banner1="/images/1.gif";
width1="300";
height1="85";
}
if (ad1==9) {
url1="/images/1.gif";
banner1="/images/1.gif";
width1="300";
height1="85";
}
if (ad1==10) {
url1="/images/1.gif";
banner1="/images/1.gif";
width1="300";
height1="85";
}
document.write('<center><a href="' + url1 + '" target="_top">');
document.write('<img src="' + banner1 + '" width=' + width1 + ' height=' + height1 + ' border=0></a>');
document.write('</center>');
// End -->
</SCRIPT>

Anyone see anything wrong?

Thanks,
Sammy

lefty
02-10-2003, 11:21 PM
Is the image not showing up or is it not being random? If it's the latter, you have all the same image names in your coding.