Frames - Opening a child with the frameset

M

mark.martinez2

Here's my problem: It is necessary to have people enter in direct
links to pages on my site, which is frame-based, but when they go to
any page that isn't the home page, the frameset doesn't load, so
they're only presented with the content of the main frame, not the top
logo or sidebar frames.

Is there a quick Javascript fix for this? I tried to Google search for
a solution, but couldn't come up with the right search terms.

Also, when navigating to sub-pages from the main page via links in the
frames, is there a way to get the address bar to show the direct-link
address to the sub-page, instead of only showing the top-level
address?

Thanks.
 
D

David Dorward

Here's my problem: It is necessary to have people enter in direct
links to pages on my site, which is frame-based, but when they go to
any page that isn't the home page, the frameset doesn't load, so
they're only presented with the content of the main frame, not the top
logo or sidebar frames.

And welcome to the wonderful world of frames. Ophan pages are one of
the main reasons why they should be avoided.
Is there a quick Javascript fix for this?

Nothing good. You can generate a new frameset document for each
combination of pages, then have JavaScript check the location of
top.location and compare it to document.location, and then alter
top.location to match.
Also, when navigating to sub-pages from the main page via links in the
frames, is there a way to get the address bar to show the direct-link
address to the sub-page, instead of only showing the top-level
address?

Link to the new frameset documents too.

Its really easier and more reliable to ditch frames in favour of some
form of server side includes or preprocessing.
 
D

David Mark

Here's my problem: It is necessary to have people enter in direct
links to pages on my site, which is frame-based, but when they go to
any page that isn't the home page, the frameset doesn't load, so
they're only presented with the content of the main frame, not the top
logo or sidebar frames.

Consider losing the frames.
Is there a quick Javascript fix for this? I tried to Google search for
a solution, but couldn't come up with the right search terms.

It's been a while, but something like this:

if (top === self) location.replace("myframeset.html?frame=mypage");

You will need a script on the server side to populate the frameset
according to the "frame" parameter.
Also, when navigating to sub-pages from the main page via links in the
frames, is there a way to get the address bar to show the direct-link
address to the sub-page, instead of only showing the top-level
address?

Not unless you want to re-run the frameset script on the server, which
would be a waste. I assume you are worried about bookmarks and you
should be. Frames are not worth the trouble and have been out of
fashion for at least ten years.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top