stevenhu — 2013-01-16T14:12:48-05:00 — #1
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?
stevenhu — 2013-01-16T18:02:15-05:00 — #2
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.
guido2004 — 2013-01-17T06:21:17-05:00 — #3
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) ?
stevie_d — 2013-01-17T08:31:23-05:00 — #4
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
<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.
stevenhu — 2013-01-17T10:40:22-05:00 — #5
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!