Refreshing Parent window after closing popup

前端 未结 6 862
南方客
南方客 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:19

    Try putting this javascript code in your popup window:

    window.onunload = function(){
      window.opener.location.reload();
    };
    

    /onunload event will trigger when you close your popup window, and window.opener.location.reload() will reload the source (parent) window./

提交回复
热议问题