?
Solved

Reference other window (not child)

Posted on 2011-09-07
10
Medium Priority
?
195 Views
Last Modified: 2012-05-12
I have a window which is opened via window.open method from an iframe.

I need to be able to access the popup window from a document in a different iframe.

I have given the popup window the name HRA and tried to call hra.close from the other iframe but it is not working. How do I get a reference to the popup window from the iframe that did not spawn it?
0
Comment
Question by:sailing_12
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 4
10 Comments
 
LVL 82

Expert Comment

by:leakim971
ID: 36497198
save the reference on the parent window.
ask the parent window to do the job (close window)
0
 

Author Comment

by:sailing_12
ID: 36497337
I don't actually want to close it, that is just a test to see if I'm referencing it successfully.

I actually want to call a function on the page.
0
 
LVL 82

Expert Comment

by:leakim971
ID: 36497410
save the reference on the parent window.
ask the parent window to do the job :)
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:sailing_12
ID: 36497564

Is this right?

<a id="aHRABalance" runat="server" onclick="var w = window.open(this.href, 'HRApopupwindow', 'width=1080,height=500,scrollbars,resizable'); return false;"></a>
0
 
LVL 82

Expert Comment

by:leakim971
ID: 36497616
remove "var "
I suppose there's a href at the end.
0
 

Author Comment

by:sailing_12
ID: 36497730
the href is being written programattically from .vb codde-behind (this is .net app).

This code successfully gets me the title of the page on which the function is written I want to fire. How do I call the function?
parent.frames['IFRAME_ResourceArea'].document.frames['ifrmBenefits'].document.title

Open in new window

0
 

Author Comment

by:sailing_12
ID: 36497822
Sorry, that last code succesfully gives me the title of the document which spawned the popup - the function I want to get at is in the head of the document loaded in the child popup.
0
 
LVL 82

Accepted Solution

by:
leakim971 earned 1600 total points
ID: 36497911
try :
parent.frames['IFRAME_ResourceArea'].document.frames['ifrmBenefits'].the_function()


0
 

Author Comment

by:sailing_12
ID: 36498152
I got it. Included the reference to the child window (renamed hraPopupRef)
parent.frames['IFRAME_ResourceArea'].document.frames['ifrmBenefits'].hraPopupRef.UncheckHRAClaims()

Open in new window

0
 

Author Closing Comment

by:sailing_12
ID: 36498165
Thanks.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question