By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,743 Members | 1,122 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,743 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
> "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

P: n/a
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

P: n/a
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.