Home > Web Front-end > JS Tutorial > Detailed explanation of the use of js opener_javascript skills

Detailed explanation of the use of js opener_javascript skills

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-05-16 17:04:17
Original
1188 people have browsed it

In JS, window.opener is just a reference to the parent window of the pop-up window. For example: In
a.html, window.open opens a new window b.html by clicking a button. Then in b.html, you can reference a.html through window.opener (omitted and written as opener), including the document and other objects of a.html, and operate the content of a.html.
If this reference fails, null will be returned. Therefore, before calling the opener object, you must first determine whether the object is null, otherwise a JS error of "the object is empty or does not exist" will occur.

Example
opener.html

Copy code The code is as follows:










back2opener.html
Copy code The code is as follows:




Add





JS code:
window.open();
When the payment is successful Afterwards, 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();
Related labels:
js
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
Where is js written?
From 1970-01-01 08:00:00
0
0
0
js addClass not working
From 1970-01-01 08:00:00
0
0
0
js file code not found
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template