Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

switch frames off

5 views
Skip to first unread message

Song Yang

unread,
Mar 23, 1996, 3:00:00 AM3/23/96
to sy...@phys.ufl.edu
On netscape framed pages, you can click an item to make the frame
dispear, but I cannot make it happen.

The way I tried and failed is

<A HREF="javascript:parent.frames.content.document.location"
TARGET="_top">No frames</A>

Instead of showing hte document, the window showed the URL name.

Any fix?

Song

Erica L. Sadun

unread,
Mar 23, 1996, 3:00:00 AM3/23/96
to
In article <31539F...@phys.ufl.edu>, Song Yang <sy...@phys.ufl.edu> wrote:
>On netscape framed pages, you can click an item to make the frame
>dispear, but I cannot make it happen.
>
>The way I tried and failed is
>
><A HREF="javascript:parent.frames.content.document.location"
>TARGET="_top">No frames</A>

What is happening is a new (non framed) page is loaded into the
whole window (_top).

Do this:

<A HREF="HTTP://www.foobar.com/" TARGET="_TOP">XXXX</A>

And give it a real address. You can preconstruct this address when
creating the page.

--
================================NUDAS ACIRE===========================
...gnirpS eht fo snomead ho ,yam ey tslihw oof perG
ude.hcetag.cc@acire
======================================================================

Frank McNeil

unread,
Mar 23, 1996, 3:00:00 AM3/23/96
to
Erica L. Sadun (er...@cc.gatech.edu) wrote:

: In article <31539F...@phys.ufl.edu>, Song Yang <sy...@phys.ufl.edu> wrote:
: >On netscape framed pages, you can click an item to make the frame
: >dispear, but I cannot make it happen.
: >
: >The way I tried and failed is
: >
: ><A HREF="javascript:parent.frames.content.document.location"
: >TARGET="_top">No frames</A>

: What is happening is a new (non framed) page is loaded into the
: whole window (_top).

: Do this:

: <A HREF="HTTP://www.foobar.com/" TARGET="_TOP">XXXX</A>

This will work, but I'd rather avoid coding a lot of TARGET attributes,
when all I want to do is link directly without frames into whatever
external URL is in a framed window.
In other words, I'd rather let the user of my pages decide when to
escape Frames. I'm starting to read the manual to see if there is a way,
before I put a framed version of a site (with 1,000+ external links) online.

help and thanks.

frank

Frank McNeil
ftme...@best.com

Matt Holmes

unread,
Mar 23, 1996, 3:00:00 AM3/23/96
to Frank McNeil
<SNIP>

> This will work, but I'd rather avoid coding a lot of TARGET attributes,
> when all I want to do is link directly without frames into whatever
> external URL is in a framed window.
> In other words, I'd rather let the user of my pages decide when to
> escape Frames. I'm starting to read the manual to see if there is a way,
> before I put a framed version of a site (with 1,000+ external links) online.

Try this:

<SCRIPT>
<!--
Button = '<FORM>'
Button += '<input type="button" value="Frames Off"
onClick="parent.location=parent.existing_frame.location">'
Button += '</FORM>'
document.write (Button)
// -->
</SCRIPT>

In the onClick section, the "existing_frame" refers to the name of the frame that holds the url your want to
goto when the button is pressed. For example, if you set up a frameset with 2 frames (one named "main" and one
named "contents"), you would put the word main in place of existing_frame so that when the button is pressed,
the url in the frame named main will become unframed!

I hope this helps!

Matt
http://www.execpc.com/~mholmes/

Gordon McComb

unread,
Mar 23, 1996, 3:00:00 AM3/23/96
to
I came in late to this thread, so pardon me if I'm missing some important info that's
already been covered (and my news server doesn't seem to keep old messages around for long).

But if you want to use a default target for frames and links, I believe the TARGET attribute
in the <BASE> tag will do what you want. Netscape talks about it a bit in their general
frames doc. You could conceivably write some JavaScript to excluse/include the <BASE> tag,
thereby switching the default on and off. Haven't tried it me-self, but on the surface it
sounds like it ought to work (but there, so do so many other projects in JavaScript that end
up on the cutting-room floor!).

-- Gordon
http://gmccomb.com/javascript/


Frank McNeil wrote:
>
> Erica L. Sadun (er...@cc.gatech.edu) wrote:
> : In article <31539F...@phys.ufl.edu>, Song Yang <sy...@phys.ufl.edu> wrote:
> : >On netscape framed pages, you can click an item to make the frame
> : >dispear, but I cannot make it happen.
> : >
> : >The way I tried and failed is
> : >
> : ><A HREF="javascript:parent.frames.content.document.location"
> : >TARGET="_top">No frames</A>
>
> : What is happening is a new (non framed) page is loaded into the
> : whole window (_top).
>
> : Do this:
>
> : <A HREF="HTTP://www.foobar.com/" TARGET="_TOP">XXXX</A>
>

> This will work, but I'd rather avoid coding a lot of TARGET attributes,
> when all I want to do is link directly without frames into whatever
> external URL is in a framed window.
> In other words, I'd rather let the user of my pages decide when to
> escape Frames. I'm starting to read the manual to see if there is a way,
> before I put a framed version of a site (with 1,000+ external links) online.
>

> help and thanks.
>
> frank
>

Frank McNeil

unread,
Mar 24, 1996, 3:00:00 AM3/24/96
to

IMHO, using target is not desirable, if there is a way to allow the user
to turn the frames off. IMO, the Adobe Acrobat type of visual format,
with the table of contents on the left is very useful since that space
isn't being used anyway.
Putting the target attribute in the A element destroys the User Interface
that the frames provide. A JavaScript botton would be better.

frank

Gordon McComb (gmc...@gmccomb.com) wrote:
: I came in late to this thread, so pardon me if I'm missing some important info that's

Frank McNeil

unread,
Mar 24, 1996, 3:00:00 AM3/24/96
to mho...@execpc.com
Matt Holmes (mho...@execpc.com) wrote:
: <SNIP>

: > This will work, but I'd rather avoid coding a lot of TARGET attributes,
: > when all I want to do is link directly without frames into whatever
: > external URL is in a framed window.
: > In other words, I'd rather let the user of my pages decide when to
: > escape Frames. I'm starting to read the manual to see if there is a way,
: > before I put a framed version of a site (with 1,000+ external links) online.

: Try this:

: <SCRIPT>
: <!--
: Button = '<FORM>'
: Button += '<input type="button" value="Frames Off"
: onClick="parent.location=parent.existing_frame.location">'
: Button += '</FORM>'
: document.write (Button)
: // -->
: </SCRIPT>

I changed existing_frame to the name of my display window.
The display window is the window that displays the URL I've linked to.


: In the onClick section, the "existing_frame" refers to the name of the frame that holds the url your want to

: goto when the button is pressed. For example, if you set up a frameset with 2 frames (one named "main" and one
: named "contents"), you would put the word main in place of existing_frame so that when the button is pressed,
: the url in the frame named main will become unframed!

I did that and it worked like magic offline. Great.

: I hope this helps!

It helps. Thanks Matt. [I really apprecated the e-mail copy!]
Actually I thought it solved the problem. But then, when I put the pages
online for a test I found that when the URL in the display frame was external
to my site it doesn't work as I want. The Frame goes away but the browser
is pointing to a local directory instead of the exteranl URL.

Is there a simple solution or is it impossible? Any comments would be
helpful. Thanks.

Later,

frank

Frank McNeil
ftme...@best.com

Frank McNeil

unread,
Mar 25, 1996, 3:00:00 AM3/25/96
to

Frank McNeil (ftme...@nntp.best.com) wrote:

: IMHO, using target is not desirable, if there is a way to allow the user


: to turn the frames off. IMO, the Adobe Acrobat type of visual format,
: with the table of contents on the left is very useful since that space
: isn't being used anyway.
: Putting the target attribute in the A element destroys the User Interface
: that the frames provide. A JavaScript botton would be better.

: frank

Perhaps I should be more clear. I wanted the user to be able to turn
frames off when they use my site to link to another site, and the user
no longer wants my table of contents to my site on the left side of the
pages. Sure I could force the User out of my site by putting the target
attribute in the A element; but if a JavaScript function or some other
trick would allow the user to stay at the external site that's in the
the display frame when frames are turned off it would be great.
Most of the time the user will prefer to stay linked to my site, but
eventually they'll see another site they want to stay at.

Anyway, I refuse to put a framed version of the site online, until I find out
if there is some trick I can use to do what I thought would be obvious.
That is, escape a framed environment while remaining at the URL in one of the
Frames that isn't at the site of the master Framset document.
[I would have thought this, like using tags to force Netscape 2.01 to
ignore HTML that non-framed systems process, would have been a very needed
function or trick; and therefore something that has already been discussed.]

To the next web weekend; this one was a bust. I should have studied JavaScript
rather than code the rest of my site to fit into a framed version of it.

frank

: Gordon McComb (gmc...@gmccomb.com) wrote:
: : I came in late to this thread, so pardon me if I'm missing some important info that's
: : already been covered (and my news server doesn't seem to keep old messages around for long).

: : But if you want to use a default target for frames and links, I believe the TARGET attribute
: : in the <BASE> tag will do what you want. Netscape talks about it a bit in their general

Unless the <BASE> tag is not at my site.

: : frames doc. You could conceivably write some JavaScript to excluse/include the <BASE> tag,

or add a <BASE> tag to someone elses site?

: : thereby switching the default on and off. Haven't tried it me-self, but on the surface it

Erica L. Sadun

unread,
Mar 25, 1996, 3:00:00 AM3/25/96
to

(Sorry about including all of the original posts, but context, context,
context!)

"And it is written in the book of Mozilla, chapter 9, verse 2:

And should thou wish to escape the burden of thy frames
And should thou wish to grant this escape to thy readers
Then reach forth thy hand and create a third frame in which
Thou must place two links.

These links, of a written and clickable nature, shalt say
[View Index Alone] and [View Page without Index] or other words
of wisdom great and context sure.

And each shall call a JavaScript function. And each function shall call
a location. And this location shall be recovered from the frames.

And the target, great and mighty, alone in its power to direct
the course of man and web broswser, this target you shall call

_TOP"

HTH -- Erica

p.s. "And it is written in the book of Mozilla that thou shalt include
the height and width attributes for all gifs in thy pagse"


In article <4j5dsd$s...@nntp1.best.com>,
Frank McNeil <ftme...@nntp.best.com> wrote:
:

Jerome Blake

unread,
Mar 27, 1996, 3:00:00 AM3/27/96
to Frank McNeil

Geez! So many options and I still found one they didn't cover!

You could open a new browser window... with target="_blank". Yeah, I
know... that target attribute. But it does do what you want, some way or
another.

-----------------------------------------------------
Jerome Blake
jer...@cqc.com

Everyone can learn something new... if not, they're too stuvk on
themselves.

Chris Underhill

unread,
Mar 28, 1996, 3:00:00 AM3/28/96
to
-----BEGIN PGP SIGNED MESSAGE-----

Well I've spent most of today trying to find a solution to this
problem. Essentially what I've ended up with is a "kill-frames"
link in the left-hand frame, which has the following specification:

<A HREF="" onClick="this.href=parent.right.document.location; return true"
onMouseOver="warn(); return true" TARGET="_top">Kill Frames</A>

The warn function displays a warning message in the status bar, together
with the value of parent.right.document.location (referred to as prdl
from now on).

It seems that prdl always has the correct value for the "right" frame
when the right frame is hosted locally, but as soon as it becomes an
external site, it stays stuck at the last internal site it showed before
going external.

As far as I can tell, this is a bug, and it has defied all my attempts to
work around it. The status bar warning is not a solution, but at least
it should stop a few head scratches from visitors to my site.

There is another hassle that I found while mucking around with this
problem - what happens when the right-hand frame contents are
generated on-the-fly by a CGI script? Clicking on the "kill frames"
link results in the browser putting a request with no content,
and with my (admittedly poorly-written:-)) scripts, this causes
a "Server Misconfiguration" error.

I've had to modify all my scripts to check for CONTENT_LENGTH=0
to get round this - essentially I changed them all to nph form and
if CONTENT_LENGTH is 0, then use the HTTP redirection directive to
send the browser back to the page containing the original form that
generated the first dynamically-generated right frame. This again is
not a very satisfactory solution if you are more than one level deep
into dynamically generated pages.


-----BEGIN PGP SIGNATURE-----
Version: 2.6.2i

iQCVAwUBMVsb6mZVEN0KDxVBAQH5uAQAvfWsTQ0vjJNWCj+ws4agh+dgqkLayNSR
8guTf7eOf0abjOL6RnIDlMYoZXjVNjgANHik1C47bqt5Z8EEjsU4NhNuQ4ZiepOm
exG6yfVPgacufS9lu4FkXeWQZhz97TafZsBRqXC2BWOaK3spXYLAfbFYvVO9khft
XW2qoB+AR6Q=
=FeHu
-----END PGP SIGNATURE-----

0 new messages