Click to See Complete Forum and Search --> : How do I call a parent .hta window from a frame?


mitya
10-31-2003, 09:27 AM
Hi

Can anyone tell me how to access the parent .hta window from within one of its iframes? Is it just a case of knowing javascript's heirarchy of reference?

Bascially, I have a link in the iframe which says javascript:window.close();

I expected that to shut the hta window but it won't. Yet if I put the same link in the .hta file itself (i.e. not in a frame) it closes fine.

Thanks in advance for any help.

Shampie
10-31-2003, 12:08 PM
I can't check out if this works right now but perhaps you can,

javascript:this.parent.window.close();
let me know if that works..

mitya
11-01-2003, 05:47 AM
Thanks for the reply but no, unfortunately it doesn't work. I can't access the .hta at all from the frame, even by trying to call functions set within the .hta.

Buggar :(

Cainnech
12-12-2007, 06:34 PM
Hi,

I had the same problem with an application that I had.
But an HTA has a built in security for all information being displayed in an Iframe.

However if the content can be trusted, you can disable this security by adding in the Iframe-tag: application="yes".

So that would become:

<iframe src="mypage.htm" application="yes">

Now your child window has access to your parent window.

Good luck with it!

conjur
10-06-2009, 09:56 PM
THANK YOU!

I realize that this thread is ancient; however, I searched for 4 hours for a solution to this problem, and finally found it here.

again, THANK YOU!

V/r,
Conjur