J
Jimmy
It is also possible for popup window to call function in main window
by using the opener property. Will "opener.someFunctionInMain(param1,
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="testPopup()">
<script type="text/javascript">
<!--
var popupWindow;
function testPopup() {
popupWindow = window.open("child.html", "Pop", "width=700,
height=400, scrollbars=1, dependent=yes");
popupWindow.focus();
}
// NOTE this one doesn't work in Mozilla and just commented out
//popupWindow.onunload = function() {
// alert("closing child");
//}
// NOTE this doesn't seems to work either
popupWindow.onunload = 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="blahValue"/>
</form>
</body>
</html>
by using the opener property. Will "opener.someFunctionInMain(param1,
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="testPopup()">
<script type="text/javascript">
<!--
var popupWindow;
function testPopup() {
popupWindow = window.open("child.html", "Pop", "width=700,
height=400, scrollbars=1, dependent=yes");
popupWindow.focus();
}
// NOTE this one doesn't work in Mozilla and just commented out
//popupWindow.onunload = function() {
// alert("closing child");
//}
// NOTE this doesn't seems to work either
popupWindow.onunload = 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="blahValue"/>
</form>
</body>
</html>