First, the window is automatically closed at a scheduled time in JSP.
<Script language = "JavaScript">
<! --
Function closewin (){
Self. Opener = NULL;
Self. Close ();
}
Function clock (){
I = I-1
Document. Title = "this window will be closed automatically after" + I + "seconds! ";
If (I> 0)
SetTimeout ("clock ();", 1000 );
Else
Closewin ();
}
VaR I = 10
Clock ();
// -->
</SCRIPT>
Type 2: Close the window by clicking the JSP that is not prompted for the link
<A href = "javascript: Self. Close ()"> close the window </a>
Third: The Window does not display the JSP code that is automatically closed.
<Script language = JavaScript>
<! --
This. Window. Opener = NULL;
Window. Close ();
// -->
</SCRIPT>
IE6-7 JSP Close Window does not prompt Method
Method 1:
JSP code: Jining website creation
Function closewin () // This does not prompt whether to close the browser
{
Window. Opener = NULL;
// Window. Opener = top;
Window. Open ("", "_ Self ");
Window. Close ();
}
Method 2:
Open.html
JSP code
Function open_complex_self (){
VaR obj_window = your own open('close.html ',' _ Self ');
Obj_1_1_opener = window;
Obj_1_1_focus ();
}
Close.html
JSP code
Window. Close ();
Appendix:
// The error message "close" appears in the normal mode.
Function closeie (){
Window. Close ();
}
// Disable IE6. No prompt
Function closeie6 (){
Window. Opener = NULL;
Window. Close ();
}
// Disable IE7. No prompt
Function closeie7 (){
Window. Open ('', '_ top ');
Window. Top. Close ();
}