A random banner showing only the first image
I have external javascript that contains:
function random_imglink(){
var myimages=new Array()
myimages[1]="http://sevir.sitegoz.com/jchs/Banner1.png"
myimages[2]="http://sevir.sitegoz.com/jchs/banner2.png"
myimages[3]="http://sevir.sitegoz.com/jchs/banner3.png"
myimages[4]="http://sevir.sitegoz.com/jchs/banner4.png"
myimages[5]="http://sevir.sitegoz.com/jchs/banner5.png"
myimages[6]="http://sevir.sitegoz.com/jchs/banner6.png"
var ry=Math.floor(Math.random()*myimages.length)
if (ry==0)
ry=1
document.write('<img src="'+myimages[ry]+'" border=0>')
}
And my html contains:
<script language="JavaScript">
<!--
random_imglink()
//-->
</script>
But only the first image is loaded.
My site is here , the banner has to change every time any of the pages is loaded (or reloaded) but only the first image appears, any ideas?
+1
source to share
1 answer
Apache servers are case sensitive. You have "Banner1", but none of the other banners. When I try to navigate to other images (lowercase "b"), I am redirected to the hosting site - saying that the filenames do not exist.
This might not mean you aren't getting other images, but it certainly doesn't help.
+2
source to share