Skip to main content
Inspiring
June 13, 2006
Question

how to fix random banner changes?

  • June 13, 2006
  • 1 reply
  • 263 views
OK - got my positioning in the right place, but what am I doing wrong, since out of my 6 images (the random banners) only one will show up? All are in the same folder/path...after the 1st one loads successfully, when I reload, I just get a "?" mark logo in my banner area.

How to fix this?

Here's what I got in my head section:


<SCRIPT LANGUAGE="JavaScript">

<!-- This script and many more are available free online at -->

<!-- The JavaScript Source!! http://javascript.internet.com -->


<!-- Begin

var maxAdNo = 6

var adNo

var myAd = new Array()



myAd[0] = '<img src="images/banners/homeBanner.jpg" width="800" height="212" border="0">'

myAd[1] = '<img src="images/banners/homeBanner2.jpg" width="800" height="212" border="0">'

myAd[2] = '<img src="images/banners/homeBanner3.jpg" width="800" height="212" border="0">'

myAd[3] = '<img src="images/banners/homeBanner4.jpg" width="800" height="212" border="0">'

myAd[4] = '<img src="images/banners/HomebannerTinCan.swf" width="800" height="212" border="0">'

myAd[5] = '<img src="images/banners/SFbanner.swf" width="800" height="212" border="0">'



// End -->

</script>


Here's what I got in my body section:


<tr>
<td align="middle" bgcolor="#336600"><img height="10" src="images/spacer.gif" width="3" /></td></tr>
<tr>
<td>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td bgcolor="#ffffff" height="1"><img height="1" src="images/spacer.gif" width="3" /></td></tr>
<tr>
<td width="800">

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin

adNo = Math.round(Math.random() * maxAdNo)

document.write(myAd[adNo])

// End -->

</script>
</td>



Thanks
KB
This topic has been closed for replies.

1 reply

CamEdAuthor
Inspiring
June 14, 2006
Any thoughts at all?

KB