Click to See Complete Forum and Search --> : array links


bmitchellt
03-04-2003, 11:45 AM
i am a fairly new to the web biz and was wondering how i might be able to make a link from an array object. BASICALLY I HAVE DIFFERENT IMAGES FOR DIFFERENT DAYS OF THE WEEK, BUT I WANT THOSE IMAGES TO LINK TO ANOTHER PAGE. the array that writes the images is below. -thanks!!!!!!!

<SCRIPT LANGUAGE="javascript">

Preview= new Array()

Preview[1]="<IMG BORDER=0 SRC=APR.preview1>"
Preview[2]="<IMG BORDER=0 SRC=APR.preview1>"
Preview[3]="<IMG BORDER=0 SRC=APR.preview1>"

//array continues to Preview[31]

RightNow = new Date()
var TodaysPreview = Preview[RightNow.getDate()]
document.write(TodaysPreview)


</SCRIPT>

gil davis
03-04-2003, 11:51 AM
Have you missed the obvious?

Preview[1]="<a href='whatever.htm'><IMG BORDER=0 SRC=APR.preview1></a>"

bmitchellt
03-04-2003, 12:17 PM
indeed. you have foiled the adage, ask a stupid question, get a stupid answer. thanks for your help!