Forum Moderators: open
[4]Parent.html[4]
<html>
<input type="button" value="PressMe" onclick="javascript:confirms()">
<script>
function confirms(){
mainwin = window.open('child.html');
}
[4]child.html[4]
<html>
<input type="button" value="Yes" onclick="return pressyes();return true;">
<input type="button" value="No" onclick="return pressno();return false;">
<input type="button" value="Cancel" onclick="window.close();">
<script>
function pressno(){
return false;
window.close();
}
function pressyes(){
return true;
window.close();
}
</script>
</html>
PARENT
<html>
<head></head>
<body>
<input type="button" value="PressMe" onclick="confirms(); return true"><script type="text/javascript">
function confirms(){
mainwin = window.open('child.html');
}
</body>
</html>CHILD
<html>
<head></head>
<body>
<input type="button" value="Yes" onclick="return pressyes()">
<input type="button" value="No" onclick="return pressno()">
<input type="button" value="Cancel" onclick="window.close(); return true"><script type="text/javascript">
function pressno(){
window.close();
return false;
}
function pressyes(){
window.close();
return true;
}
</script>
</body>
</html>
HOWEVER, window.close() will close the calling window, and terminate scripting immediately I think.
Kaled.