PDA

View Full Version : closing parent window


g00fy
02-08-2003, 10:40 AM
hi there to all,

i am *trying* to create a search engine (similar to the boojum) but i want to keep the search window modul (ontop no matter what)

how can i do this, i have tried onblur=window.focus(); but it doesnt work,

also i have trouble closing both windows from the one i want to keep modul, only if the parent window has already been closed, i do some checking but obviously not the right way :(

the page is at
http://www.madcomputing.com.au/search/search.html

if you visit here the large page is the parent and it calls the smaller one that i want to keep on top until the one of its buttons are clicked.

code called from form button - i used this to make the opener the child window so i could close the parent without a prompt.


function closeWin(){

parentWin = window.opener;
parentWin.opener=window.self;

if (!window.opener.closed && window.opener != null){
window.self.close();
parentWin.close()
}
else{
window.self.close();
}
}



thanx all,

g00fy

Mr J
02-08-2003, 02:28 PM
To keep a window always on top put


<BODY onBlur="self.focus()">

in the popup window page

Unfortunately you cannot access anything in the window underneath.

A second option would be to use a Modeless window but to use this as you require, it would mean using a frameset because when the opener page is closed the Modeless window closes too.