I have a popup on which i have a button, on click of it, a popup opens. When i close the first popup, the second popup should also close. The second popup should not close during first popup page reload.
function openWindow() {
var url = "http://www.google.com";
popupWindow = window.open(url,window.self");
window.onbeforeunload = function() { popupWindow.close(); };
}
I did try this, but as per the above code, the second popup closes for every page reload.