I have a hyperlinked image ("button" in a MenuFrame.
This link w/image, in my frame is defined like this:
<a id="link" href=" target="_blank"><img name="button" src="Picture1.jpg"></a>
On my main page I have an array of my pictures with corresponding links, in the header like this:
var objects=2
var o=new Array()
var l=new Array()
o[1]="Picture1.jpg"
l[1]="o[2]="Picture2.jpg"
l[2]="
I want to chose a random image when this main page is loaded, actually I want the image and link to change every few minutes, but that another story. This is how I chose a random image and link:
Today=new Date()
object=Math.round(Today/86400000) % objects+1
parent.MenuFrame.document.images['button'].src=o[object]
parent.MenuFrame.document.links['link'].href=l[object]
The above works PERFECT in Netscape and Opera, but Internet Explorer gives me an error. If I then change my reference to the link, to an absolute instead of named like this:
parent.MenuFrame.document.links[10].href=l[object]
IE gives me no errors, but it does NOT change the link.
What am I doing wrong here?
This link w/image, in my frame is defined like this:
<a id="link" href=" target="_blank"><img name="button" src="Picture1.jpg"></a>
On my main page I have an array of my pictures with corresponding links, in the header like this:
var objects=2
var o=new Array()
var l=new Array()
o[1]="Picture1.jpg"
l[1]="o[2]="Picture2.jpg"
l[2]="
I want to chose a random image when this main page is loaded, actually I want the image and link to change every few minutes, but that another story. This is how I chose a random image and link:
Today=new Date()
object=Math.round(Today/86400000) % objects+1
parent.MenuFrame.document.images['button'].src=o[object]
parent.MenuFrame.document.links['link'].href=l[object]
The above works PERFECT in Netscape and Opera, but Internet Explorer gives me an error. If I then change my reference to the link, to an absolute instead of named like this:
parent.MenuFrame.document.links[10].href=l[object]
IE gives me no errors, but it does NOT change the link.
What am I doing wrong here?