1. Close the JS code of the window without any hint
<a href="javascript:window.opener=null;window.open (', ' _self '); Window.close (); "> Close </a>
2. Custom Prompt off
<Scriptlanguage= "JavaScript">//This script is a generic script for IE6 and IE7functionCustom_close () {if(Confirm ("Are you sure you want to close this page? ") ) {Window.opener=NULL; window.open ("','_self'); Window.close ();}Else{}}</Script><inputID= "Btnclose"type= "button"value= "Close this page"OnClick= "Custom_close ()" />
3. Close the current page:
<ahref= "javascript:window.opener=null;window.close ();">Shut down</a>If the button is: Response.Write ("<Scriptlanguage=\ "Javascript\">Window.opener=NULL; Window.close ();</Script>");
This will not pop up as the current window is trying to close the dialog box.
So how about that? When the user points the browser to maximize the Minimize Close button in the Close button also pops up the closed confirmation dialog box?
<onbeforeunload= "Return" Do you really want to close this window? ' " >
So in the point of closing time will be executed onbeforeunload function, pop really to close this window of the dialog box, point cancel return false, do not close, point OK return true close window
So how to be able to click on a button to pop the OK Cancel dialog box?? If the point cancel does not execute the following code, click OK to continue executing the following code?
In the button's click, write:
Response.Write ("<Scriptlanguage=\javascript\ ">" + "if(Confirm (\"OK? \ "))"+"{window.location.href= ' default.aspx ';}"+"else{history.back ();}"+"</Script>");
This means: First use the Confirm function to pop up a dialog box with OK Cancel, if you click OK to return to true, execute window.location.href= ' default.aspx ' code, if the point is canceled return False, execute History.back () ; Return to the original page
JS Close the current page (window) several ways to summarize