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

Opening link in parent window

P: n/a
Greetings;

I am unable to solve this problem; I hope someone will come up to show
his brilliance.
From my web page I open another link in another browser window. That
new window is composed of two frames. I have a <a
href="....."> link on the second frame of that window. What I want is
that when user clicks on the link in the new window's second frame,
the response should open in the original browser window that opened
this secondary window(which is made of two frames). How can I do it?I
hope i have explained my problem.

I tried to used window.opened.location.href but it didnt work because
I have frames in my secondary window...

Thanks
Jul 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
"Farooq Karim" wrote:

From my web page I open another link in another browser window. That
new window is composed of two frames. I have a <a
href="....."> link on the second frame of that window. What I want is
that when user clicks on the link in the new window's second frame,
the response should open in the original browser window that opened
this secondary window(which is made of two frames). How can I do it?


You can do it a couple of ways. As Martin suggested, you can use named
windows. That is probably the preferred method.

If you opened the second window with window.open(), you can use [top.opener]
as a reference to the original window. In this case, [top] refers to the
window that contains the frameset, and that window has an [opener] property
containing a reference to the original:

top.opener.location.replace("myNewURL.asp")
--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
Jul 20 '05 #2

P: n/a
@SM
Farooq Karim a ecrit :

Greetings;

I am unable to solve this problem; I hope someone will come up to show
his brilliance.

From my web page I open another link in another browser window. That
new window is composed of two frames. I have a <a
href="....."> link on the second frame of that window. What I want is
that when user clicks on the link in the new window's second frame,
the response should open in the original browser window that opened
this secondary window(which is made of two frames). How can I do it?I
hope i have explained my problem.
Glou glou glou ...
Glup glup glup ...

- 1st window : frame11 - frame12 - frame13
- 2nd window : frame21 - frame22

- window2-frame22 : link to window1-frame13

<a href="page007.htm" target="_blank"
onclick="opener.frame13.location=this.href;
return false;
">Page 007</a>
I tried to used window.opened.location.href
* window.opener.MyFrame.location.href *
^^^^^^ ^^^^^^^
but it didnt work because
I have frames in my secondary window...


Not only ... *opened* is not correct

*opener* works only if it refers to a window in which
a page have a the JS *window.open()* that opened the
new window that use this *opener*

glup glup glup ... :-)

-- ----
@SM
move away *OTEZ-MOI* from my reply url
Jul 20 '05 #3

P: n/a
Thanks Dave!

I just used

top.opener.location.href = link

it worked perfectly.

"Dave Anderson" <GT**********@spammotel.com> wrote in message news:<ej**************@TK2MSFTNGP12.phx.gbl>...
"Farooq Karim" wrote:

From my web page I open another link in another browser window. That
new window is composed of two frames. I have a <a
href="....."> link on the second frame of that window. What I want is
that when user clicks on the link in the new window's second frame,
the response should open in the original browser window that opened
this secondary window(which is made of two frames). How can I do it?


You can do it a couple of ways. As Martin suggested, you can use named
windows. That is probably the preferred method.

If you opened the second window with window.open(), you can use [top.opener]
as a reference to the original window. In this case, [top] refers to the
window that contains the frameset, and that window has an [opener] property
containing a reference to the original:

top.opener.location.replace("myNewURL.asp")

Jul 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.