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?
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.
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) ?
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.
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!
This topic is now closed. New replies are no longer allowed.