The first type: JS automatically closes the window at a scheduled time
Second type: Click the link to close the window with JS without prompt
Close the window
Third type: The window does not prompt for automatic closing js code
How to close the window without prompting in IE6-7 JS
Method 1:
js code
function CloseWin() //This will not prompt whether to close the browser
{
window.opener=null;
//window.opener=top;
window.open("","_self");
window.close();
}
Method 2:
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();
Attached:
//Normal closing with prompts
function closeie(){
window.close();
}
//Close IE6 without prompting
function closeie6(){
window.opener=null;
window.close();
}
//Close IE7 without prompting
function closeie7(){
window.open('','_top');
window.top.close();
}