I need to open a popup, then after closing the popup (refresh the parent page)
The jquery 'beforeunload' event does not work in Internet Explorer 8.9.
my code is:
$("div.main form div.tallymanlist").click(function() { if(gencargo.show_confirm('Add new tallyman?')) { var windowObject = gencargo.windowOpener(600,1400, "Tallyman",$(this).children().attr("url")); gencargo.windowParentRefresh(windowObject); } });
The gencargo object is content (window open):
windowOpener : function (windowHeight, windowWidth, windowName, windowUri) { var centerWidth = (window.screen.width - windowWidth) / 2; var centerHeight = (window.screen.height - windowHeight) / 2; newWindow = window.open(windowUri, windowName, 'resizable=0,width=' + windowWidth + ',height=' + windowHeight + ',left=' + centerWidth + ',top=' + centerHeight); newWindow.focus(); return newWindow; },
and also close the window:
windowParentRefresh : function(object) { $(object).bind('beforeunload', function () { object.opener.location.reload(); }); }
Close window event does not work. Only in FireFox, Chrome, Opera.
source share