There is this javascript reference site that I often use and I was
looking for some script that would randomly show one of three images on
page refresh.
Here is the reference site that I use:
http://www.chalcedony.com/javascript/scripts/index.html
Here is their example:
http://www.chalcedony.com/javascript/scripts/index.html
Here is the page that I built for my company's site:
http://www.otpp.com/web/website.nsf/...uates&students
This works like a peach except for MAC IE in which it does not work at
all and just displays a blank square no matter how many times you
refresh the page.
Here is the javascript header code:
<script language="Javascript" type="text/javascript">
<!-- Hide script from old browsers
myPix = new
Array("../web/bennertestimonial/$FILE/bennertestimonial.jpg","../web/cheungtestimonial/$FILE/cheungtestimonial.jpg","../web/ttrottestimonial/$FILE/ttrottestimonial.jpg")
imgCt = myPix.length
function choosePic() {
if (document.images) {
randomNum = Math.floor((Math.random() * imgCt))
document.myPicture.src = myPix[randomNum]
}
}
// End hiding script from old browsers -->
</script>
Here is the body onload:
onload="choosePic()"
Here is the image tag:
<img src="../web/bennertestimonial/$FILE/bennertestimonial.jpg"
width="565" height="177" alt="" border="0" name="myPicture">
I would suspect that there is something in this javascrpt code that is
not supported by the DOM on a MAC IE.
Does anyone know what that is, know what a work around would be or how
I can get this to work?
All help is appreciated.