I need to open a pop-out window, then after close pop-out window (refresh a parent page)
jquery 'beforeunload' event not working in internet explorer 8,9.
my code is:
/*
* events
* add tallyman
*/
$("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);
}
});
gencargo object is content (window open):
/*
* open window
*/
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 window close:
windowParentRefresh : function(object) {
$(object).bind('beforeunload', function () {
object.opener.location.reload();
});
}
Close window event is not working in ie. Only in FireFox, Chrome, Opera.