Results 1 to 9 of 9

Thread: links between frameset, iframe & ...

  1. #1
    Join Date
    Feb 2010
    Posts
    8
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default links between frameset, iframe & ...

    hi. sorry for my english.
    i have a frameset. that has 2 frames. in evry frame 2 frames avaliable.
    my ask: how can i links between frames of frame set and iframe. iframe to iframe and iframe too frame set?
    i mean like this picture
    Last edited by R@iny; 02-21-2010 at 08:57 AM.

  2. #2
    Join Date
    Feb 2010
    Posts
    8
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    and how can i open a link from other page too a frame of frame set?
    and how can i open a link from an iframe to main page?
    Last edited by R@iny; 02-21-2010 at 10:54 AM.

  3. #3
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    As long as each of your frames and iframes have a unique name (not id), these should be able to be used as the target attribute of the link:

    Code:
    <a href="some.htm" target="frame_2">Something</a>
    To open a link in an iframe to the page it is on, make the target _parent:

    Code:
    <a href="some.htm" target="_parent">Something</a>
    To open a link from inside an iframe on a page inside a frameset to take over the entire window, use _top:

    Code:
    <a href="some.htm" target="_top">Something</a>
    That's all just ordinary HTML.

    To set the load of a specific page into a specific frame when a frameset or page is loaded, one could use a query, post, or session string in conjunction with a server side language like PHP or asp. Or javascript could be set to use a query string. Or using ordinary HTML one could have a separate frameset/page for each link that needs it.

    But frankly, unless there is just no other way of organizing your content, the use of frames of any kind (iframe or frameset) is mostly just confusing to setup and to maintain, and can often limit the sort of scripts you can use.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  4. #4
    Join Date
    Feb 2010
    Posts
    8
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    for example what code of link between frame3 of FramesetFrame2 and Frame1 of FramesetFrame1 (like to picture)

    and

    what code of link between frame3 of framesetFrame2 and FramesetFrame1

    and

    what code of open a link from other page too a frame of frame set?

  5. #5
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    As I said, the drawback to organizing one's site like this is that it can quickly become confusing. First I would have to know the names of all of those frames, and exacltly what you would want to happen in whatever given one that you are talking about, by its name, when a given link is clicked.

    But it's not quite so complicated as it might sound. And though I would advise against organizing one's site in this manner - say frameset one has an iframe in it by name of 'bob' and you want a link on a page in an iframe on a page in frameset two to place an image in 'bob':

    Code:
    <a href="some.jpg" target="bob">Some Image</a>
    This assumes that there is no other frame or iframe with a name attribute of 'bob'. It gets tricky though because it also assumes that the 'bob' iframe exists, which could be hard to be certain of. You really can have no guarantee about how folks get to the page with that link on it. But the worst that could happen is that the image would open instead in a new window/tab or be blocked. As long as you think it through though, most folks would probably be in the framesets you envision with the pages loaded as expected for it to work like you want. I just don't happen to be a big fan of of pages that only work most of the time.

    If you want more help, please post a link to an example and describe exactly what you want to have happen that isn't.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  6. #6
    Join Date
    Feb 2010
    Posts
    8
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    please use simply because my english is too bad.
    it is sample file http://rapidshare.com/files/354172654/Frames.zip.html

  7. #7
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Here it is all fixed up like I think you want it:

    Attachment 3162
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  8. The Following User Says Thank You to jscheuer1 For This Useful Post:

    R@iny (02-23-2010)

  9. #8
    Join Date
    Feb 2010
    Posts
    8
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    thank u.
    an answer:
    i have a page. it have a link. i need to open this link to Frameset-frame1.

    Notice: this page no has frame set. it open in different page(that has a frameset)
    how can i?

  10. #9
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    The easiest way is to make up a new frameset page that has this page as its src attribute for Frameset-frame1 named frame.

    Then, instead of linking to the page you want to be in the frameset, link to this new frameset page which already has the page where you want it to be.

    A javascript can be placed on the page in the new framset to load the new frameset if the page is navigated to by itself. But this shouldn't be relied upon, as many folks have no javascript. It's just a nice touch.

    Alternatively, if you have PHP*, the frameset may be a PHP page that you pass the page to be loaded into the frameset via a get, post, or session string variable.


    *Other server side languages like asp, etc. may be used for this as well. PHP is the most popular.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

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