Data transfer between window.open () and window.close () pages

Open a new page with window.open () in the old page, and close the new page with window.close () after the operation of the new page. At this time, how can you detect the closure of the new page on the old page and accept the new page data to refresh the old page?

Mar.03,2021

  

define variables and update the display method in the window of the parent window, then get the parent window through window.opener in the child window, modify the values that need to be updated, update the display of the old window by method before closing the child window, and finally window.close () close the child window (because if you refresh, the values you pass in the past will be available, unless you save to cookie or localStorage)

Menu