Refreshing Parent window after closing popup

前端 未结 6 751
南方客
南方客 2020-12-11 02:45

I am creating a popup window that goes to hello.html. I want my original (parent page) to reload when i close the popup window (hello.html). I can\'t seem to get it to wor

6条回答
  •  囚心锁ツ
    2020-12-11 03:21

    Do it like this, after creating the popup monitor its "closed" status property in an interval. But this is added in the parent document:

    var pop = window.open("page.html", "popup",
                "width=800,height=500,scrollbars=0,title='popup'");
        pop.focus();
    
        var monitor = setInterval(function() {
    
            if (pop.closed) {
                document.location.reaload()
            }
    
        }, 1000);
    

提交回复
热议问题