In JS, window. opener only references the parent window of the pop-up window. This article mainly introduces the use of opener in js. For more information, see. opener is just a reference to the parent window in the pop-up window. For example:
A.html, click "click" and click "other" to open a new window B .html. Contents.
If this reference fails, null is returned. Therefore, before calling an opener object, you must first determine whether the object is null. Otherwise, a JS error "the object is empty or does not exist" will occur.
Example
Opener.html
The Code is as follows:
Back2opener.html
The Code is as follows:
JS Code:
Window. open ();
When the payment is successful, you need to close the payment platform payment success interface, and load the client payment success page on the client, JS Code:
Window. opener. location. href = url; window. close ();