[thelist] Javascript: tricky closing of window

Ben Henick persist1 at io.com
Tue Feb 6 16:52:33 CST 2001


On Tue, 6 Feb 2001, Karl de Lautier @ Datawebs wrote:

> I have a framed window, named mainWin, which produces a pop-up, named
> newWin. What I want to do is OnLoad of newWin is to close mainWin. In
> the body tag I have tried OnLoad="mainWin.close()" and variations, and
> even OnLoad="opener.window.close()" and variations, all to no 
> avail. Does anyone have any ideas?

In the page contained by newWin:

<body 
  onload="window.opener.close()">

You want to make sure, however, that the script that opened newWin is
located in the top-level page of mainWin (e.g. in the HEAD of the page
containing the FRAMESET).


HTH
-- 
Ben Henick
Web Author At-Large
http://www.io.com/persist1/
persist1 at io.com

"Are you pondering what I'm pondering, Pinky?"
"I think so, Brain, but... (snort) no, no, it's too stupid."
"We will disguise ourselves as a cow."
"Oh!" (giggles) "That was it exactly!"





More information about the thelist mailing list