View Full Version : Iframes, Uframes, We all frames for....

Boot Weasel
07-11-2003, 06:55 PM

Look, I guess what I want to know is, is it possible to reference iframes on another page?

In other words, my website is trying to be a simple one page template with a logo and border at the top and a border at the bottom. In the middle, I put two iframes, one that is s'posed to house a few different menues and one that displays the contents of the links on each menu. I call my left frame "menu" and my right frame "contents."

NOW, all my links are on those menues which are separate pages I want displayed in my "menu" iframe. Is it possible to reference those "menu" and "contents" iframes on my template page from my menu pages? And if so, how do I write JavaScript that allows these offsite links to change both frames at once?

Thanks, buddies.

07-11-2003, 07:01 PM
sounds a little bit confusing for me... you can reference either your "template" from iframes, calling it "parent", or the iframes from parent, calling them by their id or even name... if this is your problem... give us some more details, please

Boot Weasel
07-11-2003, 08:28 PM
My attempt to change two frames with one button goes like this:

<script language="javascript">
function dotwo(pageA,pageB)


<td width="100%"><a href="#" onclick="dotwo('DrMenu.htm','BioStaff.htm')"><img border="0" src="mainme3.gif" width="195" height="20"></a></td>


results in the following error message:

'menu' is undefined.

I'm supposing this is because the iframe 'menu' is ON ANOTHER PAGE. Nobody has a solution for how to reference this in the JavaScript, and we're talking the whole internet here. How do I point to iframe 'menu' on another page? Anybody?

07-12-2003, 12:14 AM
One simple answer would be (if I've understood you correctly):

<a onclick="window.open('DrMenu.htm','menu') ; window.open('BioStaff.htm','contents')" href="#">

<img border="0" src="mainme3.gif" width="195" height="20">


This would open the two pages inside the iframes...

Boot Weasel
07-12-2003, 08:05 AM
I can't believe I finally have a solution after a week. Does this solution even use JavaScript at all? Either way, thanks, Lazaroth, it works, you are swell.


07-12-2003, 11:14 AM
Yes Boot, on an event/handler (onclick, omouseover, onload) you can call any functions you want, separated by ;

07-14-2003, 04:31 AM
iframes work just like frames. but instead of naming them in the file like you would a standard frame, they have to be referenced in the code itself where you embed the page. i found that the same code that changes regular frames works the exact same way in the iframes. :D