got it to work
i'm a bug killa!! B-)
u have 2 make win1..win4 global variables, but not define'em in the functions..
take a look at my files:
win4.htm
~~~~~~~~~
<html>
<head>
<title>win4</title>
<script>
var win3
function op(){
win3=open('win3.htm','','')
}
function cl(){
if (window.win3){
if (win3.win2){
if (win3.win2.win1){
win3.win2.win1.close()
} win3.win2.close()
}
win3.close()
}
// top.close()
}
//onunload=cl
</script>
</head>
<body bgcolor="#FFFFFF">
<input type=button value=open onclick="op()"><br>
<input type=button value="close children" onclick="cl()"><br>
</body>
</html>
~~~~~~~~~
win3.htm
~~~~~~~~~
<html>
<head>
<title>win3</title>
<script>
var win2
function op(){
win2=open('win2.htm','','')
}
function cl(){
if (window.win2){
if (win2.win1){
win2.win1.close()
} win2.close()
} top.close()
}
//onunload=cl
</script>
</head>
<body bgcolor="#FFFFFF">
<input type=button value=open onclick="op()"><br>
<input type=button value="close children" onclick="cl()"><br>
</body>
</html>
~~~~~~~~~
win2.htm
~~~~~~~~~
<html>
<head>
<title>win2</title>
<script>
var win1
function op(){
win1=open('win1.htm','','')
}
function cl(){
if (win1){
win1.close()
} top.close()
}
//onunload=cl
</script>
</head>
<body bgcolor="#FFFFFF">
<input type=button value=open onclick="op()"><br>
<input type=button value="close children" onclick="cl()"><br>
</body>
</html>
~~~~~~~~~
win1.htm
~~~~~~~~~
~whatever
~~~~~~~~~ Victor