frames

D

David de Kloet

Hi,

My website uses frames and one should always load the frameset and not
only one of the frames. Is there a nice way to ensure/check that a page is
actualy loaded within a frameset?

thanks,

David
 
P

PeterMcC

David said:
Hi,

My website uses frames and one should always load the frameset and not
only one of the frames. Is there a nice way to ensure/check that a
page is actualy loaded within a frameset?

Well, if you must use frames...

Putting the following in the head of your pages will mean that, in the event
of a frame being loaded without the frameset, the page will default to
index.html. Whilst this doesn't give the visitor the framed page that they
were expecting, it does give them a complete frameset with a menu so that
they can at least navigate the site.

<script language="javascript">
if (document.location == top.location)
{
document.location="index.html";
}
</script>

I'd also suggest that there are lots of ways of getting rid of frames - the
"I want to have the same menu on every page without repeating it" is the
benefit that I hear most often and that's easily solved with includes:
http://www.bignosebird.com/sdocs/include.shtml

HTH
 
D

David de Kloet

Well, if you must use frames...

I know what you mean.
<script language="javascript">
if (document.location == top.location)
{
document.location="index.html";
}
</script>

Thanks, just what I was looking for.
I'd also suggest that there are lots of ways of getting rid of frames - the
"I want to have the same menu on every page without repeating it" is the
benefit that I hear most often and that's easily solved with includes:
http://www.bignosebird.com/sdocs/include.shtml

I'm aware that you should reconsider the moment you want to you frames but
I think frames serve a purpous on my site so I'll just keep my frames.


David
 
J

Jeffrey Silverman

Hi,

My website uses frames and one should always load the frameset and not
only one of the frames. Is there a nice way to ensure/check that a page is
actualy loaded within a frameset?

thanks,

David

Yes. Never, *ever*, use frames.

problem solved.
 
M

Marc

My website uses frames and one should always load the frameset and not
Yes. Never, *ever*, use frames.

problem solved.

That's silly. There are several places when using frames is a good idea.
One example that comes to mind is firmware for a router or somesuch that has
a web interface. No PHP or ASP server can be run there, so frames provide a
good way to show a menu on all pages.

If they were pointless, then W3C would have depreciated them long ago.
 
J

Jeffrey Silverman

That's silly. There are several places when using frames is a good idea.
One example that comes to mind is firmware for a router or somesuch that
has a web interface. No PHP or ASP server can be run there, so frames
provide a good way to show a menu on all pages.

If they were pointless, then W3C would have depreciated them long ago.

Yes, but he is not developing firmware for a router, is he?

As far a 94.8% of website devlopment goes, frames are a bad idea. This
means, for all intents and purposes, *never* use frames.

Allright, allright, I get your point. Okay, I amend my statement.

Only use frames if you *really* *really* *really* know what you are doing,
or are developing firmware for a router.

later...
 
S

Steve Pugh

Marc said:
That's silly. There are several places when using frames is a good idea.
One example that comes to mind is firmware for a router or somesuch that has
a web interface. No PHP or ASP server can be run there, so frames provide a
good way to show a menu on all pages.

1. Why do you need to show a menu on all pages? Isn't a link back to a
dedicated menu page as good if not better?
2. Even if you need to show a menu on all pages why does it need to be
in a frame and not part of the real page?
If they were pointless, then W3C would have depreciated them long ago.

ITYM deprecated (no 'i'). And is 1997 long enough ago for you? Frames
were deprecated as soon as they were standardised.

Steve
 
D

David de Kloet

Yes, but he is not developing firmware for a router, is he?

No I'm not. I have two frames, left and right. At the left you can search
a database and get results. If you click on a search result at the left,
the frame at the right displays details about the chosen result.

If you know "Magic: the Gathering" you can try it at:
http://www.cs.vu.nl/~dskloet/magic

How would you replace these frames?

As far a 94.8% of website devlopment goes, frames are a bad idea. This
means, for all intents and purposes, *never* use frames.

Allright, allright, I get your point. Okay, I amend my statement.

Only use frames if you *really* *really* *really* know what you are doing,
or are developing firmware for a router.

later...


David
 
D

David Dorward

PeterMcC said:
Putting the following in the head of your pages will mean that, in the
event of a frame being loaded without the frameset, the page will default
to index.html. Whilst this doesn't give the visitor the framed page that
they were expecting, it does give them a complete frameset with a menu so
that they can at least navigate the site.

Example of what happens when you use this method. (Real example)

A user (lets call him 'David Dorward') searches Google for information.
David finds a site with the information.
David clicks the link and waits for page to load.
David looks for the information.
He can't find it.
After a while he goes back to google and looks for a different side with the
information on it.

(Then becuase he can't find any other site (unusual) he disables JS, goes
back to the site, and notices that it looks entirely different to the way
it looked last time - becuase without JS he didn't get redirected to the
homepage).
 
D

David de Kloet

Example of what happens when you use this method. (Real example)

A user (lets call him 'David Dorward') searches Google for information.
David finds a site with the information.
David clicks the link and waits for page to load.
David looks for the information.
He can't find it.
After a while he goes back to google and looks for a different side with the
information on it.

(Then becuase he can't find any other site (unusual) he disables JS, goes
back to the site, and notices that it looks entirely different to the way
it looked last time - becuase without JS he didn't get redirected to the
homepage).

But without the JS you would have gotten the wrong page both times but now
when you notice something is different you find out that you should go to
the frameset instead of the other page.

But is there a nice way to solve this google-problem other than not using
frames? (I mean the problem that google finds the content and not the
frameset.)

David
 
P

PeterMcC

David said:
Example of what happens when you use this method. (Real example)

A user (lets call him 'David Dorward') searches Google for
information. David finds a site with the information.
David clicks the link and waits for page to load.
David looks for the information.
He can't find it.
After a while he goes back to google and looks for a different side
with the information on it.

(Then becuase he can't find any other site (unusual) he disables JS,
goes back to the site, and notices that it looks entirely different
to the way it looked last time - becuase without JS he didn't get
redirected to the homepage).

Yes, that's right.
 
D

David Dorward

Paul said:
There is an alternative to this. There is a product called Framejammer
that is a Dreamweaver extension. It's a little bit of JavaScript that
sits in every page. When a framed page is requested, it realises that
it's frameset isn't present, loads the frameset and loads the page.
It's a bit like how MSDN works.

(a) Only works when JS is available
(b) You still need a frameset document for every combination of pages.
 
M

Marc

That's silly. There are several places when using frames is a good idea.
1. Why do you need to show a menu on all pages? Isn't a link back to a
dedicated menu page as good if not better?

Fair point.
2. Even if you need to show a menu on all pages why does it need to be
in a frame and not part of the real page?

This is a problem becuase the device has a very limited space allowance, and
thus anything to reduce file size is a must.
ITYM deprecated (no 'i'). And is 1997 long enough ago for you? Frames
were deprecated as soon as they were standardised.

What is ITYM?
 
K

Kevin Thorpe

Yes. Never, *ever*, use frames.

Why not? Sometimes they're really useful. Do you always use Windows
Explorer with the folder list turned off?

I would correct your statement above to:
Use frames only if there is a significant benefit in using them.

....but of course frames/no frames is a religious argument so there will
be no consensus.
 
M

Marc

But without the JS you would have gotten the wrong page both times
So I guess I shouldn't redirect but just provide a link to the frameset
and a message to encourage peolple to follow the link.

Since I'm very bad with JavaScript could someone tell me how I print a
message instead of redirecting? Or just give a link to a nice JS Tutor :)

What does this have to do with JS? Just put an HTML link!

<p>You're in the wrong place!</p>
<a href="frameset.html">Click here to go to the frameset</a>

Simple!
 
D

David Robley

No I'm not. I have two frames, left and right. At the left you can search
a database and get results. If you click on a search result at the left,
the frame at the right displays details about the chosen result.

If you know "Magic: the Gathering" you can try it at:
http://www.cs.vu.nl/~dskloet/magic

How would you replace these frames?

Didn't look at the referenced URL but...

ASCII ART WARNING - USE FIXED FONT

HEADER PART shows whatever blah blah blah

menu1 | main page
menu2 | main page
menu3 | main page
menu4 | main page
This page sponsored by blah wibble etc

Where you use a prepend/append pair of pages to create the header and menu
(prepend) and append to do the 'This page...' and the main part of the
page is the 'current script'

For an example see http://auseinet.flinders.edu.au
 
P

PeterMcC

Marc said:
What does this have to do with JS? Just put an HTML link!

<p>You're in the wrong place!</p>
<a href="frameset.html">Click here to go to the frameset</a>

Simple!

But wouldn't it be necessary to use js to identify whether the page was
showing within its frameset? Otherwise the "You're in the wrong place!" is
going to show whether or not the page is within its frameset.

It's problematic - once frames are used, the difficulties can, at best, be
only partially solved. However, ISTR, the OP said that he was committed to a
framed site - despite my urging him to try SSI :)
 
M

Marc

But without the JS you would have gotten the wrong page both times
But wouldn't it be necessary to use js to identify whether the page was
showing within its frameset? Otherwise the "You're in the wrong place!" is
going to show whether or not the page is within its frameset.

OK then, use and IF statement:

<p>IF you're in the wrong place!</p>
<a href="frameset.html">Click here to go to the frameset</a>

:p
 
D

David de Kloet

On Wed, 9 Jul 2003, David Robley wrote:

Didn't look at the referenced URL but...

And you didn't read my post either. I don't have a menu and I wouldn't use
frames to implement one.

<about a menu>

David
 

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
474,075
Messages
2,570,555
Members
47,197
Latest member
NDTShavonn

Latest Threads

Top