swapping iframes within same page

Discussion in 'HTML' started by richard, Oct 30, 2006.

  1. richard

    richard Guest

    I'm thinking of a simple 2 division page on which the top division is a
    menu.
    The 2nd division is an iframe which changes depending on the menu choice.
    I know there is a way to do it and hopefully without javascript.
    Just need to brush up on how to do it properly. Who's got a sample for me?
     
    richard, Oct 30, 2006
    #1
    1. Advertising

  2. richard

    patrick j Guest

    On Mon, 30 Oct 2006 07:24:42 +0000, richard wrote
    (in article <>):

    > I'm thinking of a simple 2 division page on which the top division is a
    > menu.
    > The 2nd division is an iframe which changes depending on the menu choice.
    > I know there is a way to do it and hopefully without javascript.
    > Just need to brush up on how to do it properly. Who's got a sample for me?


    It's very easy to do.

    However i|Frames and indeed Frames in general are considered to be
    rather old school these days.

    All you do is give the iFrame a name in the iFrame element, then when
    you link to the file to "supply" the iFrame put the iFrame's name as
    the target.

    Here's the lnk:

    <a href="thelinkedfile.html" target="nameofiframe">linked text</a>

    So obviously you have one of these links for each of the files you are
    planning on having as a possibility to fill the iFrame.

    And now the iFrame:

    <iframe src="defaultiframesupplyfile.html" name="nameofiframe"
    width="500" height="500" frameborder="0"></iframe>

    In the iFrame you'll see "defaultiframesupplyfile.html", this is to be
    the path and filename of the file which fills the iFrame when no link
    has been clicked. You'll see frameboard="0" this can be set to 0 or 1.
    This is to turn off or on the iFrame boarder. It is more often turned
    off these days.


    --
    Patrick
    Brighton, UK

    <http://www.patrickjames.me.uk>
     
    patrick j, Oct 30, 2006
    #2
    1. Advertising

  3. richard wrote:
    > I'm thinking of a simple 2 division page on which the top division is a
    > menu.
    > The 2nd division is an iframe which changes depending on the menu choice.
    > I know there is a way to do it and hopefully without javascript.
    > Just need to brush up on how to do it properly. Who's got a sample for me?
    >


    Since you are generating you page server-side I cannot understand why
    you would need to include with an IFRAME.

    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
     
    Jonathan N. Little, Oct 30, 2006
    #3
  4. richard

    richard Guest

    "Jonathan N. Little" <> wrote in message
    news:920c5$45460ea8$40cba7a4$...
    > richard wrote:
    >> I'm thinking of a simple 2 division page on which the top division is a
    >> menu.
    >> The 2nd division is an iframe which changes depending on the menu choice.
    >> I know there is a way to do it and hopefully without javascript.
    >> Just need to brush up on how to do it properly. Who's got a sample for
    >> me?
    >>

    >
    > Since you are generating you page server-side I cannot understand why you
    > would need to include with an IFRAME.


    2,000 plus files as a possibility to be selected would be more easily
    accomplished in an iframe.
    Saving to have needlessly repeat the menu on every page.
     
    richard, Oct 30, 2006
    #4
  5. richard

    richard Guest

    "patrick j" <> wrote in message
    news:...
    > On Mon, 30 Oct 2006 07:24:42 +0000, richard wrote
    > (in article <>):
    >
    >> I'm thinking of a simple 2 division page on which the top division is a
    >> menu.
    >> The 2nd division is an iframe which changes depending on the menu choice.
    >> I know there is a way to do it and hopefully without javascript.
    >> Just need to brush up on how to do it properly. Who's got a sample for
    >> me?

    >
    > It's very easy to do.
    >
    > However i|Frames and indeed Frames in general are considered to be
    > rather old school these days.
    >
    > All you do is give the iFrame a name in the iFrame element, then when
    > you link to the file to "supply" the iFrame put the iFrame's name as
    > the target.
    >
    > Here's the lnk:
    >
    > <a href="thelinkedfile.html" target="nameofiframe">linked text</a>
    >
    > So obviously you have one of these links for each of the files you are
    > planning on having as a possibility to fill the iFrame.
    >
    > And now the iFrame:
    >
    > <iframe src="defaultiframesupplyfile.html" name="nameofiframe"
    > width="500" height="500" frameborder="0"></iframe>
    >
    > In the iFrame you'll see "defaultiframesupplyfile.html", this is to be
    > the path and filename of the file which fills the iFrame when no link
    > has been clicked. You'll see frameboard="0" this can be set to 0 or 1.
    > This is to turn off or on the iFrame boarder. It is more often turned
    > off these days.


    Ok. But assume I have 10 possible choices. Do I just use the <iframe src>
    tag within a division for each of the choices? Changing the name
    accordingly?
     
    richard, Oct 30, 2006
    #5
  6. richard

    patrick j Guest

    On Mon, 30 Oct 2006 16:37:10 +0000, richard wrote
    (in article <>):

    > Ok. But assume I have 10 possible choices. Do I just use the <iframe src>
    > tag within a division for each of the choices? Changing the name
    > accordingly?


    No, the href in the link sends that page to the iframe.

    All the src in the iframe element does is tell what the iframe will
    display if no link has been clicked.

    If you want to look at an example of it, I use them at my web-site (but
    don't tell anybody).

    Here:

    <http://www.patrickjames.me.uk/clubpromotion/gallery.html>

    the thumbnail links open images in an iframe below the links. Each jpg
    is kept in an html "wrapper" so when you click on the thumbnail in fact
    you are clicking on a link to that html "wrapper" to fill the iFrame
    below.

    Here:

    <http://www.patrickjames.me.uk/cv/cv.html>

    the timeline is an imagemap containing links to an iframe below the
    imagemap.

    Here:

    <http://www.patrickjames.me.uk/music/music.html>

    there are two iframes. The one on the left has links which direct the
    content for the one on the right.

    In each case it is the same, each iframe has an src which fills the
    iframe with a "default" content which is displayed if nothing is
    clicked, most notably when you first come to the page.

    Then once you click on one of the links, the href in the link tells the
    iframe what to display.

    The link knows where to send the href because you have the target in
    the link set to the name of the iframe.

    --
    Patrick
    Brighton, UK

    <http://www.patrickjames.me.uk>
     
    patrick j, Oct 30, 2006
    #6
  7. richard

    richard Guest

    "richard" <> wrote in message
    news:...
    > I'm thinking of a simple 2 division page on which the top division is a
    > menu.
    > The 2nd division is an iframe which changes depending on the menu choice.
    > I know there is a way to do it and hopefully without javascript.
    > Just need to brush up on how to do it properly. Who's got a sample for me?
    >


    http://www.samisite.com/test-csb2nf/id43.htm

    This page shows exactly what I want to do but the page source is riddled
    with JS and a ton of other garbage it's hard to understand how to do it
    properly.

    Trying to find simple coding is like looking for a needle in a haystack.
    I'd like a simpler practical example if possible.
     
    richard, Oct 30, 2006
    #7
  8. richard

    richard Guest

    "richard" <> wrote in message
    news:...
    > I'm thinking of a simple 2 division page on which the top division is a
    > menu.
    > The 2nd division is an iframe which changes depending on the menu choice.
    > I know there is a way to do it and hopefully without javascript.
    > Just need to brush up on how to do it properly. Who's got a sample for me?
    >


    Ok so I got it all sorted out and all is working fine so far.
     
    richard, Oct 30, 2006
    #8
  9. richard wrote:
    >
    > "Jonathan N. Little" <> wrote in message
    > news:920c5$45460ea8$40cba7a4$...
    >> richard wrote:
    >>> I'm thinking of a simple 2 division page on which the top division is
    >>> a menu.
    >>> The 2nd division is an iframe which changes depending on the menu
    >>> choice.
    >>> I know there is a way to do it and hopefully without javascript.
    >>> Just need to brush up on how to do it properly. Who's got a sample
    >>> for me?
    >>>

    >>
    >> Since you are generating you page server-side I cannot understand why
    >> you would need to include with an IFRAME.

    >
    > 2,000 plus files as a possibility to be selected would be more easily
    > accomplished in an iframe.
    > Saving to have needlessly repeat the menu on every page.


    It isn't needless, it's the better way to do it. Among reasons why:

    1. Otherwise, people won't be able to bookmark your pages or send links
    to them to other people.

    2. Search engines will either ignore your site, they'll display links to
    the material that goes into the IFRAMEs, which means that anyone who
    comes to your site via the search engine won't see your navigation.

    But you define the common code on every page. You put it in a separate
    file and #include it on each page with the following one-line directive:

    <!--#include file="common_file_name"-->
     
    Harlan Messinger, Oct 30, 2006
    #9
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Peter Jaffe
    Replies:
    0
    Views:
    1,192
    Peter Jaffe
    Feb 4, 2004
  2. vijay

    IFRAMEs show the same page

    vijay, Jan 10, 2006, in forum: HTML
    Replies:
    1
    Views:
    474
    Beauregard T. Shagnasty
    Jan 10, 2006
  3. vijay

    IFRAMEs show the same page

    vijay, Jan 6, 2006, in forum: Javascript
    Replies:
    3
    Views:
    111
    vijay
    Jan 10, 2006
  4. Jon
    Replies:
    2
    Views:
    151
  5. RyanRitten
    Replies:
    2
    Views:
    112
    RyanRitten
    Jul 3, 2008
Loading...

Share This Page