Home  >  Article  >  Web Front-end  >  JavaScript closes the current page (window) without any prompts_javascript tips

JavaScript closes the current page (window) without any prompts_javascript tips

WBOY
WBOYOriginal
2016-05-16 16:54:271047browse

1. JS code to close the window without any prompt

Copy code The code is as follows:

< ;a href="javascript:window.opener=null;window.open('','_self');window.close();">Close

2 .Close the current page (prompt under IE)
Copy code The code is as follows:

< a href="javascript:window.opener=null;window.close();">Close

3. Custom prompt to close
Copy code The code is as follows:


/>

4. When the user clicks the "Close" button among the "Maximize", "Minimize", and "Close" buttons of the browser, a closing confirmation dialog will also pop up. Box
Copy code The code is as follows:


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