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

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

WBOY
Release: 2016-05-16 16:54:27
Original
1086 people have browsed it

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:


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