Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-11-2003, 05:55 PM   PM User | #1
Boot Weasel
New Coder

 
Join Date: Jul 2003
Location: around, here and there, like gypsy
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Boot Weasel is an unknown quantity at this point
Iframes, Uframes, We all frames for....

HI THERE EVERYBODY.

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.
__________________
Hey, that's all I'm saying.
Boot Weasel is offline   Reply With Quote
Old 07-11-2003, 06:01 PM   PM User | #2
Kor
Red Devil Mod


 
Kor's Avatar
 
Join Date: Apr 2003
Location: Bucharest, ROMANIA
Posts: 8,478
Thanks: 58
Thanked 379 Times in 375 Posts
Kor has a spectacular aura aboutKor has a spectacular aura about
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
__________________
KOR
Offshore programming
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Kor is offline   Reply With Quote
Old 07-11-2003, 07:28 PM   PM User | #3
Boot Weasel
New Coder

 
Join Date: Jul 2003
Location: around, here and there, like gypsy
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Boot Weasel is an unknown quantity at this point
Code for to looking at

My attempt to change two frames with one button goes like this:

<head>
<script language="javascript">
function dotwo(pageA,pageB)
{
(menu.location=pageA);
(contents.location=pageB);
}
</script>
</head>


<body>

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

</body>

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?
__________________
Hey, that's all I'm saying.
Boot Weasel is offline   Reply With Quote
Old 07-11-2003, 11:14 PM   PM User | #4
Lazaroth
New Coder

 
Join Date: Jul 2002
Location: Sweden
Posts: 66
Thanks: 1
Thanked 0 Times in 0 Posts
Lazaroth is an unknown quantity at this point
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">

</a>

This would open the two pages inside the iframes...
Lazaroth is offline   Reply With Quote
Old 07-12-2003, 07:05 AM   PM User | #5
Boot Weasel
New Coder

 
Join Date: Jul 2003
Location: around, here and there, like gypsy
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Boot Weasel is an unknown quantity at this point
Lazaroth = muy genius

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.

James
__________________
Hey, that's all I'm saying.
Boot Weasel is offline   Reply With Quote
Old 07-12-2003, 10:14 AM   PM User | #6
Kor
Red Devil Mod


 
Kor's Avatar
 
Join Date: Apr 2003
Location: Bucharest, ROMANIA
Posts: 8,478
Thanks: 58
Thanked 379 Times in 375 Posts
Kor has a spectacular aura aboutKor has a spectacular aura about
Yes Boot, on an event/handler (onclick, omouseover, onload) you can call any functions you want, separated by ;
__________________
KOR
Offshore programming
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Kor is offline   Reply With Quote
Old 07-14-2003, 03:31 AM   PM User | #7
darkannie
New Coder

 
Join Date: Mar 2003
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
darkannie is an unknown quantity at this point
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.
darkannie is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:56 AM.


Advertisement
Log in to turn off these ads.