In JS, Window.opner is only a reference to the mother window in the pop -up window. for example:
In A.html, a new window is made by clicking the button and other methods. Then in B.HTML, you can reference A.HTML through Window.Opener (omitted as Opener), including A.HTML document and other objects to operate the content of A.HTML.
If this reference fails, it will return Null. Therefore, before calling the OPENER object, you must first determine whether the object is null, otherwise the JS error with "the object is empty or does not exist" will appear.
example
opener.html
Copy code code as follows:
<html>
<body>
<FORM NAME = FORM1>
<input type = text name = inpu>
<input type = Button Onclick = "Javascript: Window.open ('Back2opner.html? Toname = Opener.Form1.inpu');">>
</form>
</body>
</html>
back2opener.html
Copy code code as follows:
<html>
<body>
<FORM NAME = FORM1>
<input type = text name = inpu>
<a class = under href =# Onclick = "{opener.document.form1.inpu.value+= 'Sun Chao,';}"> Add </a>
</form>
</body>
</html>
Js code:
window.open ();
When the payment is successful, the payment platform payment is successfully paid, and the payment success page is loaded on the client. JS code:
window.opent.location.href = url; window.close ();