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 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Oct 2002
    Location
    Seattle Area
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Target another frameset?

    Our site has several different framesets. I cannot figure out how to create a link from the "main" frame of one frameset to open a page in the "main" frame of another frameset.

    This works of course if the link is to the frameset (index.html) page of another frameset, but not if the link is to a sub page.

    For example, on our home page we have a link advertising a product. That product page needs to open in a different frameset.
    I guess the "target" attribute only works for pages within the same frameset. When I try to target the name of a frame in the other frameset, the page actually opens in a new browser window by itself, in other words, it does not recognize the target.

    Is there a way to do what I am trying to do?

    Thanks,
    Barko

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Posts
    626
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You could pass the page in the url to load in the "main" frame of the new frame set. Your frame set code would look like this:
    <html>
    <head>
    <title>Frame Print Demo</title>
    <SCRIPT LANGUAGE="JavaScript">
    function frame_saver()
    {
    if (self.location.search)
    {
    parent.frameb.location = location.search.substring(1,location.search.length);
    }
    }
    window.onload = frame_saver;
    </SCRIPT>
    </head>
    <frameset rows="25%,*" border="1">
    <frame src="looka.html" name="framea">
    <frame src="lookb.html" name="frameb">
    </frameset>

    And the link would look something like this:
    <A HREF="frset.html?mypage.html">Click Me</A>

    When you clicked on the above link it would load frset.html into the window. the script in frset.html would then check to see if anything was attached to the url and if it was it would load that into the specified frame. I also have a default page there incase something goes wrong.

  • #3
    New to the CF scene
    Join Date
    Oct 2002
    Location
    Seattle Area
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up YES!

    That works great. I had a feeling java would be the answer, but I am still a bit new with java.

    Thank you very much.

    -Barko

  • #4
    New to the CF scene
    Join Date
    Oct 2002
    Location
    Seattle Area
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation Except..

    Is there way to do this so the link to the new frameset does not open a new browser window?

    What happens is that the page opens in a new browser, in the correct frameset, in this case, the products frame. But, if you then click on the product links in the left menu frame, the pages from those links continue to open in new browsers and not inthe frame! (this is the frameset with the javascript).

    Now what is weird, is that if you go to this products page the usual way, the menu links work fine. Only in the new browser window (from the link you helped me create) do they act weird.

    Clear as mud?

    Thanks, Barko


  •  

    Posting Permissions

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