Click to See Complete Forum and Search --> : OnLoad command


Dakouv
04-24-2003, 12:54 PM
Hi all
I have a page with two frames and I want to put an OnLoad command to one of the two frames so that when it loads it tell the other frame what to load. If that makes any sense and u know how is it done plz help me out.
Thanx
DaKouv

Jona
04-24-2003, 01:06 PM
Well, commas do help. First of all, onLoad is an event handler, not a command. Second, you didn't quite make yourself clear but tell me if this helps:

<body onload="parent.frames['otherFrameName'].location='somepage.html';">

Dakouv
04-24-2003, 01:29 PM
Sorry fot that but as u see i am not very good with javascript. Anyway, I am doing a Coldfusion project for uni and i am stuck in this spot. I also forgot to tell you that i am using iframes. When the user clicks on a link, a new page with two iframes. One frame has a .jpg picture from a databse and the other iframe has some comments about the picture. I want when the iframe with the picture loads to call the comments from the database and display them to the other iframe.
thanx for your help.
DaKouv

Jona
04-24-2003, 01:31 PM
Right, try this:

<html><head><title>UNI?</title></head>
<body onload="document.getElementById('iframe1').location='somepage.html';document.getElementById('iframe2').locat ion='descriptionpage.html';">

<iframe name="iframe1" src="someimagepage.html">
</iframe>

<iframe name="iframe2" src="somecommentpage.html">
</iframe>