The first type: JS timed automatically close the window
<script language= "JavaScript" >
<!--
function Closewin ()
{
Self.opener=null;
Self.close ();
}
function Clock ()
{
I=i-1
document.title= "This window will automatically close 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
<a href= "Javascript:window.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>
Ie6-7 JS Close the window does not prompt the method
Method One:
JS Code
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
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
Window.close ();
Attach:
//normal with prompt close
function Closeie () {
Window.close ();
}
//Close IE6 not prompt
function closeie6 () {
Window.opener=null;
Window.close ();
}
//Close IE7 does not prompt
function closeie7 () {
window.open (', ' _top ');
Window.top.close ();
}