Home  >  Article  >  Web Front-end  >  js code to close browser page silently_javascript skills

js code to close browser page silently_javascript skills

WBOY
WBOYOriginal
2016-05-16 18:32:531097browse

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();
}
Statement:
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