JS implements the method of refreshing the parent page without a prompt box. js page
This example describes how to refresh the parent page without a prompt box. We will share this with you for your reference. The details are as follows:
Page A opens page B. When page B is saved as A class, you need to close page B. When page B is refreshed, A prompt box is displayed, requesting A retry, this is an unexpected situation with poor user experience.
There are two solutions:
1. Page A is very simple (without frame/iframe)
In function on page B:
Function close () {window. opener. location. reload (); window. opener = null; window. open ('', '_ self'); window. close ();}
You can.
2. The elements of page A are A bit complex and contain frames:
Requirement: If you want to refresh page A on page B
Directly call the function on page A in the function on page B. Take the most common "A" as the list page, and "B" as the new page:
There is A query button on page A to check all the lists. We will trigger this function on page B:
Function close () {window. opener. queryAll (); // queryAll () is the query function window. close ();} of page ();}
Note that if frame A on the same page jumps to frameB, instead of using opener, it uses parent.