html frame

F

Frank

Hi,

how do I switch of frames?
I have 2 frames on a page. When I click a specific reference I want that
page to load in the same browserwindow without frames. How? What happens now
is that the page is loaded in one of the frames.

Thanx

Frank
 
P

Philip Ronan

This seems to work:


<script language="JavaScript"><!--
if (self != top)
{
if (document.images)
top.location.replace(window.location.href);
else
top.location.href = window.location.href;
}
// --></script>

What?? You don't need Javascript to do this. Just add 'target="_top"' to the
link.

<A href="blah.html" target="_top">

(Although as David mentioned, you're probably better off without frames)

Phil
 
F

Frank

Philip Ronan said:
What?? You don't need Javascript to do this. Just add 'target="_top"' to the
link.

<A href="blah.html" target="_top">

(Although as David mentioned, you're probably better off without frames)

Phil


Maybe this works but I would have to put it in every href. The javascript I
only have to put once in the called html file.
Frank
 
D

David Dorward

Frank said:
Maybe this works but I would have to put it in every href.

There's this clever little thing called search and replace.
The javascript I only have to put once in the called html file.

And not have it work for those users who turn off JS, and to have it load a
page twice for at least some of those who do.

Not using frames in the first place is easier of course.
 
E

Evertjan.

Frank wrote on 03 aug 2003 in comp.lang.javascript:
Maybe this works but I would have to put it in every href. The
javascript I only have to put once in the called html file.

Solution, put in the <head>:

<base target="_top">
 

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,079
Messages
2,570,573
Members
47,205
Latest member
ElwoodDurh

Latest Threads

Top