473,403 Members | 2,338 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

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
3 3473
> "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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Unregistered | last post by:
I'm making an Intranet site for someone who is not very familiar wit making websites, thus I would like to make it as simple as possible fo her when she needs to update it. The intranet site...
6
by: foldface | last post by:
Hi I think from looking into google newsgroups history that you can't do this, however can someone confirm that: Using IE6 Can you load a web page (say www.google.co.uk) Then move to a web...
1
by: Aki | last post by:
Hi! I've been trying to create a home link in a document that is shown in a frameset of two frames. My aim is to show the first documents that were shown in the frames when the frameset was...
2
by: Tom Jordan | last post by:
Hi all, Ok, could do with some advice on this. I've written a script in ASP for a client so they can compose HTML newsletters and include various products from the online database. I didn't...
6
by: Tom Braun | last post by:
Hello! My first post here... I need to monitor if someone clicked on some (any) link in a subframe. Due to certain restrictions, the only place I can put some JavaScript is in the main...
4
by: christine.nguyen | last post by:
Hello, Here's the deal. I have an html page that contains an iframe. This iframe has an id that is unknown to me. This iframe also has test.html as it's source. Within test.html runs some...
6
by: zino | last post by:
my web application consist of 3 frames :top, left and right, and I use form authentication to authenticate users in ASP.NET 1. the right frame is where the data is displayed I set the default page...
7
by: shocron | last post by:
problem: input values not recognized in dinamicly loaded IFRAMEs here is the thing I have a parent window that has an IFRAME I then load a diffrent page into the IFRAME that contains an input ...
1
by: michal.podlewski | last post by:
Hi All, I have a problem with a simple (as I thought till now) thing: I want to make a link in a child-window which would change site in the parent-window and along with closing child window. The...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.