Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Close window created by different frame?

Status
Not open for further replies.

ChrisQuick

Programmer
Oct 4, 1999
144
US
In one frame (frame A) I have a form for running a ASP query with a submit button. The OnSubmit calls a function named opennew and passes a url that displays a "Running Query.." message in a new window while the ASP runs.

<SCRIPT LANGUAGE=&quot;JavaScript&quot;>
function opennew(page) {
messageWin = this.open(page, &quot;messageWindow&quot;, &quot;dependent=yes,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes,width=200,height=100,top=5,left=5&quot;);
}
</SCRIPT>

The results of the query is then displayed in another frame (frame B). In the code that ASP returns I've got:

<script language=&quot;JavaScript&quot;>
messageWindow.close()
</script>

I keep getting a message stating that messageWindow is not an object.

Any ideas why it doesn't work? [sig][/sig]
 
Never mind, I fixed it. I changed this:

this.open(page, &quot;messageWindow&quot;, etc..

to:

window.open(page, &quot;messageWindow&quot;, etc..

and in the other frame the code is now:

top.parent.main.framea.messageWin.close();

[sig][/sig]
 
I have the same problem, not fixed yet.
I tried this solution, and it doesn't work, and either
parent.frameName.windowName.close();
I call from top frame to asp page that is opened instead of the buttom frame, and a new window as a small pop up, which I am trying to close when the asp page finishes loading.
I declared the window name in a script, outside of any function (is it &quot;global&quot; enough?).
Anyone for help?
Thanks, Avivit
 
Just be sure you are addressing it properly, and keep track of who is opening what!

-Ben
&quot;Alright whatever man, I'll hook up the hair, but I aint touchin the ring...Cause I'm still a pla--yer&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top