The first type: JS timed automatically close the window
Copy Code code as follows:
<script language= "JavaScript" >
<!--
function Closewin () {
Self.opener=null;
Self.close ();}
function Clock () {i=i-1
document.title= "This window will be automatically closed after" +i+ "seconds!";
if (i>0) settimeout ("clock ();", 1000);
else Closewin ();}
var i=10
Clock ();
-->
</script>
The second: Click the link does not prompt JS close the window
Copy Code code as follows:
<a href= "Javascript:self.close ()" > Close window </a>
The Third Kind: The window does not have the prompt to automatically close the JS code
<script language=javascript>
<!--
This.window.opener = null;
Window.close ();
-->
</script>
Third: PHP Code submission window after the prompt information and automatically close the window of the JS code
Copy Code code as follows:
document.write "<script language=javascript>alert" (' Your message sent successfully, we see in time to contact you! '); Opener=null;window.close ();</script> "
Automatically returns the previous page's code:
Copy Code code as follows:
document.write ("<script language=" "JavaScript" ">alert" "your message sent successfully, we see you in time to contact!" ""); History.go ( -1);</script> ")
Ie6-7 JS Close the window does not prompt the method
Method One:
JS Code
Copy Code code as follows:
function Closewin ()//This does not prompt you to close the browser
{
Window.opener=null;
Window.opener=top;
window.open ("", "_self");
Window.close ();
}
Method Two:
Open.html
Copy Code code as follows:
JS Code
function Open_complex_self () {
var Obj_window = window.open (' close.html ', ' _self ');
Obj_window.opener = window;
Obj_window.focus ();
}
Close.html
JS Code
Copy Code code as follows:
Also attached:
Copy Code code as follows:
Normal with tips off
function Closeie () {
Window.close ();
}
Close IE6 do not prompt
function Closeie6 () {
Window.opener=null;
Window.close ();
}
Close IE7 do not prompt
function Closeie7 () {
window.open (', ' _top ');
Window.top.close ();
}