]; 2. Close the current page, the code is [Close]."/> ]; 2. Close the current page, the code is [Close].">
Home > Article > Web Front-end > How to turn off javascript web pages
##The operating environment of this tutorial: windows7 system, javascript1 .8.5 version, DELL G3 computer.Methods to close JavaScript web pages: 1. Close the window without any prompts, the code is [e90569361eb4f0b06f17f1f9dde68695]; 2. Close the current page, the code is [93fa92bce32e683c5c319f81ce1aa556Close5db79b134e9f6b82c0b36e0489ee08ed].
How to close the javascript web page:
1. JS code to close the window without any prompt
<a href="javascript:window.opener=null;window.open('','_self');window.close();">关闭</a>
2. Close the current page (prompt under IE)
<a href="javascript:window.opener=null;window.close();">关闭</a>
3. Close the custom prompt
<script language="javascript"> function custom_close() { if (confirm("您确定要关闭本页吗?")) { window.opener = null; window.open('', '_self'); window.close() } else {} } </script> <input id="btnClose" type="button" value="关闭本页" onClick="custom_close()" />4 , when the user clicks the "Close" button among the "Maximize", "Minimize", and "Close" buttons of the browser, a closing confirmation dialog box will also pop up. The code is as follows:
<body οnbefοreunlοad="return '真的要关闭此窗口吗?'">
Related free learning recommendations: javascript learning tutorial
The above is the detailed content of How to turn off javascript web pages. For more information, please follow other related articles on the PHP Chinese website!