Results 1 to 2 of 2

Thread: iframe linking to another iframe in a different page.

  1. #1
    Join Date
    Jan 2006
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question iframe linking to another iframe in a different page.

    Ok,

    not sure if this is possible and I've searched google and other places for help but didn't find anything that would help me.

    I need a link that is in an Iframe to open up in another parent page with the intended link opening in the iframe of that parent page.

    Can anyone here help me?

  2. #2
    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

    Where the link is, is not an issue so much as where you want it to open. In any case, this (if I understand you correctly) cannot be done with HTML alone. If this other parent page is already open (in another window) and has a name, javascript can do it (however, being sure that the user hasn't closed this other window in the meantime is a major issue). If clicking the link is to open a page in a new window, the iframe on the page in the new window must have its src attribute set to the desired page, either via its HTML attribute or via a script on that page that activates onload of that page (or at least after parsing of the desired iframe). A parameter could be passed to a script on the page that is opening in a new window, to tell it what page to open in its iframe via said script.

    Now, this type of scripting is complicated and will be useless to non-javascript enabled browsers. The same overall effect can be achieved using simple HTML though. Say you have a link on a page in an iframe. You want it to open a page (we will call this pageC.htm) in an iframe on new page (we will call this pageB.htm) in a new window, do this for the link:

    HTML Code:
    <a href="pageB.htm" target="_blank">Link Text</a>
    Then the iframe on pageB.htm can look like so:

    HTML Code:
    <iframe src="pageC.htm"></iframe>
    - 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
  •