Results 1 to 8 of 8

Thread: Replace parent page within a iframe with child pages?

  1. #1
    Join Date
    Jun 2012
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    hi, Need help with a simple problem! which has the following criteria:

    1) click on images link in iframe changes Parent page, click on another iframe image link changes Parent to another page (see below).

    It may sound simple but I'm being googled it for days now and looked over many forums.
    Code can be in html css or js, but please keep any answers simple as possible and post a full working example to work as I'm new to coding or recode the test site: http://www.howiepotter.com/parent.html





    Dear coders, I simplify the problem; now all I need is the link page (see image above) to replace the parent page with the iframe. PS the link page don't have any iframes just a simple page. Hope this is possible, here is the code for the pages (below) please update with new code and post it. PS simple keep your answers as simple as possible as I'm new to coding. thanks for any help

    Parent page code:

    <body>
    <iframe src="iframe.html" width="100%" height="150" frameborder="0" style="position:fixed; Left:0px; bottom:0px"/iframe>
    Parent Start Page
    </body>


    iframe page code:

    <body>
    <a href="link.html">iframe Link</a>
    </body>


    link page code:

    <body>
    Link Page
    </body>
    Last edited by jscheuer1; 06-27-2012 at 12:19 AM.

  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

    Change:

    Code:
    <body>
     <a href="link.html">iframe Link</a>
     </body>
    to:

    Code:
    <body>
     <a href="link.html" target="_top">iframe Link</a>
     </body>
    - John
    ________________________

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

  3. #3
    Join Date
    Jun 2012
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy

    thanks for your help & time jscheuer1,
    I made the change but still not working, link page appears & iframe disappears see http://www.howiepotter.com/parent.html

    what have I do wrong

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

    Nothing. If you want an iframe to be on the link page, put one on it.

    Unlike framesets, Iframes do not persist across pages. What you might want is a frameset, they're a lot more to think about though. And, as I say, if you just put an iframe on the link page, then it will be there.

    Other ways:

    You could use AJAX to import the content of the link page to the parent page.

    Or have another iframe at the beginning of the parent page and load link page into it.

    Whichever of those you do, the page in the bottom iframe would remain the same. That could be good or bad. But, if you simply add an iframe to link page, you can have any page be in there. It could be the same page or a different one.
    Last edited by jscheuer1; 06-27-2012 at 02:55 PM. Reason: detail
    - John
    ________________________

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

  5. #5
    Join Date
    Jun 2012
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    understand.
    Got a offbeat question: instead of using frame set & iframes, is there any other way of placing a timeline at the bottom of my site with horizontal scroller!... like soon type of fixed table with horizontal slide bar...

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

    You can hard code it on each page, or use javascript with or without AJAX, or use a server side include. Those are the only other options I can think of at the moment.
    - John
    ________________________

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

  7. #7
    Join Date
    Jun 2012
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I'm interested, how could this to done using only javascript...

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

    You would make an external script that creates the elements that you want and inserts them into the page where you want them. This script could include whatever code, if any needed to animate those elements and/or make them responsive to user interaction.

    The creation/insertion part could be done in at least several ways.

    If AJAX (which is just javascript that can fetch the content of another page) were used, a separate file could contain the HTML markup that you want inserted. AJAX will only fetch content though, so if you want to animate it and/or make it interactive, you would do that after it was fetched and inserted to the page. All fairly standard for AJAX fetched content.
    - 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
  •