Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New Coder
    Join Date
    Jul 2003
    Location
    around, here and there, like gypsy
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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.

  • #2
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    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
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #3
    New Coder
    Join Date
    Jul 2003
    Location
    around, here and there, like gypsy
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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.

  • #4
    New Coder
    Join Date
    Jul 2002
    Location
    Sweden
    Posts
    66
    Thanks
    1
    Thanked 0 Times in 0 Posts
    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...

  • #5
    New Coder
    Join Date
    Jul 2003
    Location
    around, here and there, like gypsy
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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.

  • #6
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    Yes Boot, on an event/handler (onclick, omouseover, onload) you can call any functions you want, separated by ;
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #7
    New Coder
    Join Date
    Mar 2003
    Posts
    71
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •