Home > Web Front-end > JS Tutorial > body text

js code to close browser page silently_javascript skills

WBOY
Release: 2016-05-16 18:32:53
Original
1097 people have browsed it

Method 1:

Copy code The code is as follows:

top.window.opener=null;
top.window.open("","_self");
top.window.close();


Method 2:
Copy code The code is as follows:

top.window.opener = top;
top.window.open('', '_self','');
top.window.close();

_blank, display the target webpage in a new window
_self, display the target webpage in the current window
_parent, the current entire window position in the frame web page displays the target web page
_top, in the frame web page, the target web page is displayed in the upper window

Script House’s own function
Copy code The code is as follows:

function closeWindow() {
window.open('','_parent','') ;
window.close();
}
Related labels:
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!