SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: How do I show the entire frames page when linking to one page in a frames page?

  1. #1
    SitePoint Wizard
    Join Date
    Feb 2007
    Location
    Southern California
    Posts
    1,147
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    How do I show the entire frames page when linking to one page in a frames page?

    I have a simple HTML page that fills the window. I'd like to link to a different HTML page that is in a frameset, and I want the whole frameset to fill the window, not the page by itself. How is this done?
    ----------------------------
    Steve Husting
    http://iphonedevlog.wordpress.com/

  2. #2
    SitePoint Wizard
    Join Date
    Feb 2007
    Location
    Southern California
    Posts
    1,147
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    When I had to do this in the distant past, I created a new frameset page with the layout of all the pages I wanted, and linked to that. I wondered if in the intervening years someone had come up with something else.
    ----------------------------
    Steve Husting
    http://iphonedevlog.wordpress.com/

  3. #3
    From Italy with love bronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    8,609
    Mentioned
    76 Post(s)
    Tagged
    4 Thread(s)
    Isn't that one of the reasons framesets have been abandoned, because you can't link to a specific page (since the frameset url is always the same) ?

  4. #4
    Mouse catcher silver trophy
    SitePoint Award Recipient Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,107
    Mentioned
    66 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by StevenHu View Post
    I have a simple HTML page that fills the window. I'd like to link to a different HTML page that is in a frameset, and I want the whole frameset to fill the window, not the page by itself. How is this done?
    I'm not 100% sure I'm following what you're after, but if you're saying what I think you are, there's no way to load a frameset page in anything other than its intended state. You can't say "load frames.htm but in <frame="main"> instead of home.htm I want you to put special.htm, that functionality just doesn't exist in HTML, and security is a big part of this – otherwise it would be relatively easy for unscrupulous people to inject a malicious frame into your site.

    If you control the frameset page (ie, it isn't on someone else's website), what you could do is write a nifty bit of PHP that would allow you to link to something like example.com/frames.php?main=special.htm&side=new.htm, which would load the frameset but put special.htm into <frame="main"> and new.htm into <frame="side">. This would allow you to create a frameset template but giving you the flexibility to call whatever files you wanted into it ... but you would want to put some security on there to stop other people maliciously injecting their own pages into your frameset.

    Of course, as Guido says, frames are considered a bit 20th century these days – while there are occasionally valid reasons to use them, there are almost always better ways to achieve the same goal.
    Any posts I write in Arial are on my mobile phone, so please excuse typos etc.
    Any posts I write in Verdana are on a PC, so feel free to berate me mercilessly for any mistakes


  5. #5
    SitePoint Wizard
    Join Date
    Feb 2007
    Location
    Southern California
    Posts
    1,147
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Stevie D: I can't use PHP, unfortunately, in this application (in an mobile app). There's a frameset with navigation for one section and a different navigation scheme for a different section (not a frameset). It looks like I won't be linking to the frameset version, then.

    Guido: I wondered whether something had came along to fix that. I guess not!
    ----------------------------
    Steve Husting
    http://iphonedevlog.wordpress.com/

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
  •