Question

I have an 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 loads.
My site is here, the banner is supposed to change every time any of the pages loads (or reloads) but only the first image shows up, any ideas?

Was it helpful?

Solution

Apache servers are case sensitive. You have "Banner1" capitalized, but none of the other banners. When I try to navigate to the other images (with a lower case 'b'), I am redirected to the hosting site - telling me the file names do not exist.

This may not be why you aren't getting the other images, but it certainly isn't helping.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top