For IE window.opener
will not work you have to use window.showModalDialog
. You can pass parameters from parent to child as well as child to parent. window.showModalDialog
return a value to parent based upon that you can refresh the parent. window.showModalDialog
will work for IE and FF you have to handle in JavaScript accordingly. Here is a parent child example.
parent.html
<html>
<body>
<script language="JavaScript">
function openWindow() {
var myArguments = new Object();
myArguments.bgcolor = document.all.myColor.value;
var dialogResults = window.showModalDialog("child.html", myArguments, '');
if ( (dialogResults != undefined) && (dialogResults != '') && (dialogResults != false) ){
alert(dialogResults);
window.location=window.location;
}
}
</script>
<select id="myColor">
<option value="red">Red</option>
<option value="green">Green</option>
<option value="blue">Blue</option>
<option value="yellow">Yellow</option>
</select>
<button onclick="openWindow();">Open window</button>
</body>
</html>
child.html
<html>
<head>
<script>
var oMyObject = window.dialogArguments;
var bgColor = oMyObject.bgcolor;
function closeWindow() {
alert(bgColor);
window.returnValue = 'Refresh';
window.close();
}
</script>
</head>
<body>
<a href="#" onClick="closeWindow();">Click here to close the window</a>
</body>
</html>