How to close the current page and refresh the previous page

problem description

call a method in a.html

while the a.html page window.location.open is opened to b.html
how to close b.html

the environmental background of the problems and what methods you have tried

related codes

/ / Please paste the code text below (do not replace the code with pictures)

what result do you expect? What is the error message actually seen?

Mar.28,2021

the background of the problem and the methods you have tried to describe


window.opener you can get the created parent window object
you can listen for the b page's closing event call window.opener.. Method if your method is not global, you can't call


if a page is in the same domain as b page, when b page triggers window.closed, update-localstorage variable, and listen for window.addEventListener on a page ('storage', callback, false) can be ~

).
Menu