It is also possible for popup window to call function in main window
by using the opener property. Will "opener.someFun ctionInMain(par am1,
param2)" in the popup window work?
It's possible for main window to call function in the popup window,
right? The following is a sample code (close popup window causes to
show alert window) which doesn't seems to work. Can anyone see the
problem?
// main
window /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
<html><head></head><body onLoad="testPop up()">
<script type="text/javascript">
<!--
var popupWindow;
function testPopup() {
popupWindow = window.open("ch ild.html", "Pop", "width=700,
height=400, scrollbars=1, dependent=yes") ;
popupWindow.foc us();
}
// NOTE this one doesn't work in Mozilla and just commented out
//popupWindow.onu nload = function() {
// alert("closing child");
//}
// NOTE this doesn't seems to work either
popupWindow.onu nload = doOnunload;
function doOnunload() {
// expecting alert window will show up when popup window close
alert("closing child");
}
-->
</script>
</body></html>
// popup
window /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
<html><head></head>
<body>
<form id="blahForm">
<input type="hidden" id="blahId" value="blahValu e"/>
</form>
</body>
</html>