I assign a new window ID a window and open it: function options(pid) {
var day = new Date();
var id = day.getTime();
var url='scriptname.cgi?d=Edit+Options&pid='+pid;
var win = open(url,id,'width=400,height=400,resizable,scrollbars');
}
This small pop-up window does a sub-function on a relational table: for example, if you're editing a product, this window edits the options , such as color, size, and type. On closing that window, I execute the following so that any option details in the pop-up are updated in the main page via the refresh:
function closeRefresh() {
if (window.opener &&!window.opener.closed) {
window.opener.location.reload();
window.close;
}
}
<form onSubmit="return false;"> <-- Thx BernardMarx :-) -->
<input type="submit" onClick="closeRefresh();" Value="Close and Return to Product edit">
</form>
Most of the time this works, but sometimes I get the Access Denied error. I've also changed it to window.opener.document.location.reload();, same effect. Since it's intermittent, it's not something you can debug by any normal means.
This all takes place on the same domain, so I can't imagine why it's choking on the acess error, any ideas?