We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19328
    • 433 Posts
    Hello, I’m not sure if I’m asking this in the right forum, so my apologies if this is the wrong place.

    I’ve got a small problem: I’m trying to have a ’close’ button in a popup that refreshes the parent page like the QuickEdit popup does, and then close the popup using javascript.
    I thought
    opener.window.location.reload(); window.close(); 
    would work, but nothing happens...

    Can I not use this code in MODx?
      • 4041
      • 788 Posts
      Perhaps this can shed some light on the issue:

      http://www.sitepoint.com/forums/showthread.php?t=305773
        xforum
        http://frsbuilders.net (under construction) forum for evolution
        • 19328
        • 433 Posts
        Hi Breezer,
        Thanks for your reply! I’ve tried
        onClick="window.opener.location.reload(true); window.close();"
        as the forum you pointed me to as well, but what happens now is that the homepage loads in the popupwindow.

        I’ve placed the following code in the template for the popupwindow:

        <a href="#" onClick="window.opener.location.reload(true); window.close();">Close window</a>


        When I click this link in the popup window www.myhomepage.nl/# is loaded. Nothing happens to the parent, it isn’t refreshed. The popup also doesn’t close.

        I’ve also tried:
        <a href="#" onclick="opener.window.location.reload();self.close();return false;">Close</a>


        This has the same result.

        Strange isn’t it??