+ Reply to Thread
Results 1 to 9 of 9

Thread: Links and IFRAME

  1. #1
    mc se7en's Avatar
    mc se7en is offline x10 Sophmore mc se7en is an unknown quantity at this point
    Join Date
    Oct 2009
    Location
    Chopin
    Posts
    218

    Links and IFRAME

    I'd still like an answer to this, but due to some limitation I've found with IFRAMEs, I've decided not to do this.

    ----

    I'm having a little problem using IFRAMEs in my site. Specifically, I want to use an IFRAME for my header (and footer, but I'll do that later). The header includes a navbar. When I click a link on this navbar, it opens in the IFRAME instead of the actual page.

    Here's the deal: Every time I want to change my navbar or header (or footer), I have to change it manually on every page (a painful process). I'm trying to avoid that irritation by using an easy-to-edit IFRAME to update all pages at once. So far only the navbar is in the IFRAME but I'm going to get the logo in there hopefully in a few minutes. EDIT: logo is now in the IFRAME too.

    The current page in question is [link and page removed.]

    Any help on getting these links to open in the main window would be much appreciated.

    Thanks!
    Last edited by mc se7en; 12-28-2009 at 11:56 PM.

  2. #2
    xgreenberetx is offline x10Hosting Member xgreenberetx is an unknown quantity at this point
    Join Date
    Oct 2009
    Posts
    57

    Re: Links and IFRAME

    I would make a separate page custom size it for a header only, and use the server side include function.

    <!--#include virtual="header.html" -->

    You will just have to add the links on every linked page.

  3. #3
    mc se7en's Avatar
    mc se7en is offline x10 Sophmore mc se7en is an unknown quantity at this point
    Join Date
    Oct 2009
    Location
    Chopin
    Posts
    218

    Re: Links and IFRAME

    Is there an easier way to do it? Since I'm using iWeb, that would actually be more complicated because I'd have to publish, download the page, edit the page, re-FTP it to the server and then repeat for every updated page, because iWeb replaces the entire html file when it publishes rather than just the changes to the file.
    Edit:
    ah you know, ive found some stuff that isnt going to work this way. thanks for the answer but ive changed my mind about the iframe. however, youve earned some rep. :D
    Last edited by mc se7en; 12-28-2009 at 11:57 PM. Reason: Automerged Doublepost

  4. #4
    Twinkie is offline Banned Twinkie is an unknown quantity at this point
    Join Date
    Sep 2007
    Location
    Ft. Lauderdale, Florida
    Posts
    1,389

    Re: Links and IFRAME

    You have include {target="_parent"} in the links so the browser knows you are reffering to the parent window.
    Code:
    <a href="page.html>Text</a>
    
    to
    
    <a href="page.html" target="_parent">Text</a>
    I would recommend a server side include, it is less hassle.
    Last edited by Twinkie; 12-29-2009 at 12:04 AM.

  5. #5
    mc se7en's Avatar
    mc se7en is offline x10 Sophmore mc se7en is an unknown quantity at this point
    Join Date
    Oct 2009
    Location
    Chopin
    Posts
    218

    Re: Links and IFRAME

    Quote Originally Posted by Twinkie View Post
    You have include {target="_parent"} in the links so the browser knows you are reffering to the parent window.

    Code:
    <a href="page.html>Text</a>
    
    to
    
    <a href="page.html" target="_parent">Text</a>
    I would recommend a server side include, it is less hassle.
    Ha, I knew there had to be a target for it, but Google turned up nothing. Thanks very much! It's actually less of a hassle to do that then to have to use the other method with iWeb! Thanks again! You've also been rep'd!

  6. #6
    Twinkie is offline Banned Twinkie is an unknown quantity at this point
    Join Date
    Sep 2007
    Location
    Ft. Lauderdale, Florida
    Posts
    1,389

    Re: Links and IFRAME

    I found the answer by entering: 'make links in iframe open in main window' in google :P

    Thanks for the rep
    Last edited by Twinkie; 12-29-2009 at 12:07 AM.

  7. #7
    mc se7en's Avatar
    mc se7en is offline x10 Sophmore mc se7en is an unknown quantity at this point
    Join Date
    Oct 2009
    Location
    Chopin
    Posts
    218

    Re: Links and IFRAME

    Quote Originally Posted by Twinkie View Post
    I found the answer by entering: 'make links in iframe open in main window' in google.
    I tried almost the same search with the phrase "parent frame" so im not sure why it didnt turn up. thanks for the help anyway!

    edit: whoops…its doing the same thing when i try that…weird…ah well, this is just one more reason im not using the iframe after all lol
    Last edited by mc se7en; 12-29-2009 at 12:11 AM.

  8. #8
    xgreenberetx is offline x10Hosting Member xgreenberetx is an unknown quantity at this point
    Join Date
    Oct 2009
    Posts
    57

    Re: Links and IFRAME

    Yea, I never had luck with IFrames. I use php, it does a lot more.

  9. #9
    matthew88 is offline x10Hosting Member matthew88 is an unknown quantity at this point
    Join Date
    Dec 2009
    Posts
    9

    Re: Links and IFRAME

    Well ur on this site.

    Simply make a HTML file. name it navigationbar.html
    Then to include the nav-bar in all other pages use the code

    <?php include 'http://www.example.com/navigationbar.html';?>

    idk if that could be made any easier.
    You can also inline javascript the IFRAME/URL path you want the link/frame to go to.


    ----------------------------------------

    <A href="javascript:change3()">
    <script>
    function change3()
    {
    parent.B_._pic.location="http://whatever.com/_W_/members_profiles/member01/pic3.htm";
    }</script>

    ----------------------------------------

    parent = parent frame, each . (dot on down is each sub-frame down.)
    B_ = was the body frame.
    _pic = was the picture frame.
    location = URL which the frame gets and loads.

    Hope some of this stuff helped.

+ Reply to Thread

Similar Threads

  1. Iframe and imagemap links - anyone know?
    By glitterr in forum Programming Help
    Replies: 3
    Last Post: 06-14-2009, 10:05 PM
  2. Help with IFRAME.
    By sarajevl in forum Programming Help
    Replies: 2
    Last Post: 05-26-2009, 12:38 AM
  3. iframe Troubles
    By 104lbofinsanity in forum Programming Help
    Replies: 4
    Last Post: 09-20-2008, 09:55 AM
  4. iframe help
    By PacersForever in forum Programming Help
    Replies: 10
    Last Post: 09-01-2008, 12:23 PM
  5. My site's links keep linking back to an old hosting account...
    By unaffectionate in forum Scripts & 3rd Party Apps
    Replies: 12
    Last Post: 02-15-2005, 02:42 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers