Disable the parent window on window.open and enable it when the popup closes

I have a parent window where I open a popup with the click of a button:

function Test() 
    {
            $("body").append('<div id="modalPopUp" class="modalOverlay">');
          var popupWindow = window.open("test.aspx", 'popUpWindow', 'height=300,width=600,left=100,top=30,resizable=No,scrollbars=No,toolbar=no,menubar=no,location=no,directories=no, status=No');

        }

Currently I can open the popup and disable the parent window, but now I want to catch the close button of the button + click outside the popups in the popup, so I can remove ModalPopUp from my body so that I can restore the parent of the case. How do I achieve this?

0
source share
1 answer
  • You can access the parent window in your popup using the window.opener object, or:

  • popupWindow. , , :

    popupWindow.onunload = function() {alert ( " " )}

+1

All Articles