Как исправить всплывающее окно (window.open ()) на родительское окно?Когда я нажимаю на другую вкладку, мое окно теряется.
function popitup(url, w, h) {
var dualScreenLeft = window.screenLeft != undefined ? window.screenLeft : window.screenX;
var dualScreenTop = window.screenTop != undefined ? window.screenTop : window.screenY;
var width = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : screen.width;
var height = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : screen.height;
var left = ((width / 2) - (w / 2)) + dualScreenLeft;
var top = ((height / 2) - (h / 2)) + dualScreenTop;
popupWindow = window.open(url, title,"resizeable=yes,location=no,width=" + w + ", height=" + h + ",top=" + top + ",left=" + left + ", overflow-x=hidden");
popupWindow.pw = pw;
if (window.focus) {
popupWindow.focus()
}
return false;
}