Forum Moderators: open
<body onUnload="window.opener.document.reload();">
Although if the opener requires variables for it's current state, this won't work (example: you're on a page to edit data, which requires a record ID to get to that page.) So a function that accepts the parameters you need to get to that state would work in combination with document.location:
<body onUnload="refreshMain('1234','edit_record');">
function refreshMain(pid,state) {
if ((! pid) ¦¦ (! state)) {
alert('Record ID and script state required to close and refresh.');
return;
}
if (window.opener && !window.opener.closed) {
window.opener.document.location='yourscript.cgi?yourfunction='+state+'&record_id='+pid;
window.close();
}
}
Note that ¦ must be replaced with logical OR pipes.