• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 199
  • Last Modified:

Reference other window (not child)

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
sailing_12
Asked:
sailing_12
  • 6
  • 4
1 Solution
 
leakim971PluritechnicianCommented:
save the reference on the parent window.
ask the parent window to do the job (close window)
0
 
sailing_12Author Commented:
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
 
leakim971PluritechnicianCommented:
save the reference on the parent window.
ask the parent window to do the job :)
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
sailing_12Author Commented:

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
 
leakim971PluritechnicianCommented:
remove "var "
I suppose there's a href at the end.
0
 
sailing_12Author Commented:
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
 
sailing_12Author Commented:
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
 
leakim971PluritechnicianCommented:
try :
parent.frames['IFRAME_ResourceArea'].document.frames['ifrmBenefits'].the_function()


0
 
sailing_12Author Commented:
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
 
sailing_12Author Commented:
Thanks.
0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

  • 6
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now