Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6

Thread: IFRAME question

  1. #1
    New Coder
    Join Date
    Dec 2009
    Posts
    16
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Arrow IFRAME question

    Hi all,

    For my site what I want to do is have the navigation links sitting in one iframe to the left of the page, and have the content be displayed in another iframe on the right side of the page. How would I go about so that when a person clicks a link, it changes the content of the iframe to the right of it, and not itself. Also, for the second iframe, is there a way I can have it auto resize itself to however high the content is? Thanks
    Last edited by qhx398; 12-13-2009 at 11:35 PM.

  • #2
    Master Coder
    Join Date
    Apr 2003
    Location
    in my house
    Posts
    5,211
    Thanks
    39
    Thanked 201 Times in 197 Posts
    Best not to use iframes. What if someone enters your page from a search engine which found the second iframe? you'd have no navigation. There are alos numerous styling issues with iframes because they are so rigid.

    Better, I think, either to:

    1. use shtml pages
    2. use server-side dynamically created pages.

    And if that doesn't persuade you, I am sure Aero will be about soon with some more reasons.

    hth

    bazz
    "The day you stop learning is the day you become obsolete"! - my late Dad.

    Why do some people say "I don't know for sure"? If they don't know for sure then, they don't know!
    Useful MySQL resource
    Useful MySQL link

  • #3
    New to the CF scene
    Join Date
    Dec 2009
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    And careful when using iFrame, because iFrame is breaking terms of service of Google Adsense.

    So if you planning of using Google Adsense, don't do it.

    And I think the internet nowadays are fast, so there is no need to use iFrame, just use Javascript and CSS is you want client side.

  • #4
    New Coder
    Join Date
    Dec 2009
    Posts
    16
    Thanks
    1
    Thanked 0 Times in 0 Posts
    very true, bazz thank you. I decided to scratch the Iframe idea, but I do have another question. The whole point of making the iframes was so that if I need to update my navigation bar, I can update one file and the changes will be spread across the whole site. Is there another way I can achieve this?

  • #5
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,748
    Thanks
    22
    Thanked 1,838 Times in 1,822 Posts
    Yes qhx398,
    bazz mentioned shtml and that include will do that. So will php include. Both are SSI's.
    I like php, here's a good tutorial that shows you how.
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #6
    Master Coder
    Join Date
    Apr 2003
    Location
    in my house
    Posts
    5,211
    Thanks
    39
    Thanked 201 Times in 197 Posts
    .......if I need to update my navigation bar, I can update one file and the changes will be spread across the whole site.
    shtml will let you do this. I am a bit rusty on them but, you can use SSI (server-side includes) to make a full web page. By including the various parts of your page - one of them being the nav menu - each part will be its own html file. that means if you include your nav menu as a portion of the page, you will only have to change the single nav menu file, for it to display changed on every page it is included in.

    That should get you started but soon, I should think. you'll want to make it all server-side because (as did for me a few years ago), it'll open so many more options for you.

    oh-h-h amd CF is a great place to learn how to grow - in programming terms.

    I didn't mention php includes because I haven't used them and in fact, haven't used much php. (I prefer perl for some masochistic reason ). But it's worth listening ot Excavator on that part.

    bazz
    Last edited by bazz; 12-13-2009 at 05:14 AM.
    "The day you stop learning is the day you become obsolete"! - my late Dad.

    Why do some people say "I don't know for sure"? If they don't know for sure then, they don't know!
    Useful MySQL resource
    Useful MySQL link


  •  

    Posting Permissions

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