467,080 Members | 936 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,080 developers. It's quick & easy.

How do I get a link loaded in the window, not frame?

I have, as it might be, this in a frame:

<a href="mystuff.html">Click here</a>

When I click the link, it loads mystuff.html into the frame, whereas
what I want is to replace the whole window contents. How can I do this
while still using a link? What I want in effect is for clicking to do:

top.location.href = "mystuff.html"

instead of:

window.location.href = "mystuff.html"

Thanks,

-- tim
Jul 23 '05 #1
  • viewed: 3203
Share:
3 Replies
> "Tim Streater" <ti**********@dante.org.uk> wrote:
news:ti********************************@individual .net....

I have, as it might be, this in a frame:

<a href="mystuff.html">Click here</a>

When I click the link, it loads mystuff.html into the frame, whereas
what I want is to replace the whole window contents. How can I do this
while still using a link? What I want in effect is for clicking to do:

top.location.href = "mystuff.html"

instead of:

window.location.href = "mystuff.html"

Thanks,


<a href="mystuff.html" target="_parent">Click here</a>
--
BootNic Thursday, June 23, 2005 2:27 PM

Thirty-five is when you finally get your head together and your body starts falling apart.
*Caryn Leschen*
Jul 23 '05 #2
BootNic wrote on 23 jun 2005 in comp.lang.javascript:
"Tim Streater" <ti**********@dante.org.uk> wrote:
news:ti********************************@individual .net....

I have, as it might be, this in a frame:

<a href="mystuff.html">Click here</a>

When I click the link, it loads mystuff.html into the frame, whereas
what I want is to replace the whole window contents. How can I do this
while still using a link? What I want in effect is for clicking to do:

top.location.href = "mystuff.html"

instead of:

window.location.href = "mystuff.html"

Thanks,


<a href="mystuff.html" target="_parent">Click here</a>


<a href="mystuff.html" target="_top">Click here</a>
<http://www.w3.org/TR/NOTE-layout>:

target: _blank
Loads the linked document into a new blank window. This generally
provides the same navigation controls as other browser windows. Some
users will want to be able to disable this behaviour via a browser
preference setting.

target: _popup
Loads the linked document into a pop-up window. This is similar to
"_blank" except that pop-up windows are generally borderless and
automatically sized to match the document content, disappearing when
clicked.

target: _self
Loads the linked document into the same frame as the anchor that was
clicked on. This is useful for overriding an inherited target value.

target: _parent
Loads the linked document into the immediate parent frame of the frame
containing the clicked anchor. This defaults to acting like "_self" when
the clicked anchor isn't contained by a frame (i.e. its directly part of
the page).

target: _top
Loads the linked document into the full extent of the window. This acts
like "_self" when the clicked anchor isn't contained by a frame (i.e. its
directly part of the page).

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Jul 23 '05 #3
In article <Xn*******************@194.109.133.242>,
"Evertjan." <ex**************@interxnl.net> wrote:
BootNic wrote on 23 jun 2005 in comp.lang.javascript:
"Tim Streater" <ti**********@dante.org.uk> wrote:
news:ti********************************@individual .net....

I have, as it might be, this in a frame:

<a href="mystuff.html">Click here</a>

When I click the link, it loads mystuff.html into the frame, whereas
what I want is to replace the whole window contents. How can I do this
while still using a link? What I want in effect is for clicking to do:

top.location.href = "mystuff.html"

instead of:

window.location.href = "mystuff.html"

Thanks,


<a href="mystuff.html" target="_parent">Click here</a>


<a href="mystuff.html" target="_top">Click here</a>


[snip]

Thanks guys, that's the reference I needed.

-- tim
Jul 23 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Unregistered | last post: by
6 posts views Thread by foldface@yahoo.co.uk | last post: by
1 post views Thread by Aki | last post: by
4 posts views Thread by christine.nguyen@gmail.com | last post: by
6 posts views Thread by zino | last post: by
1 post views Thread by michal.podlewski@gmail.com | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.