Here's
the fix I've found to auto close a browser window after XP SP2:
http://javascript.about.com/library/scripts/blautowindowclose.htm
Paste
the code below into the body of your html page.
<!--
begin close window script -->
<script language="JavaScript">
// Set the following variable to the number of seconds the browser
// will wait before closing the window.
var gWindowCloseWait = 5;
function SetupWindowClose()
{
window.setTimeout("window.close()",gWindowCloseWait*1000);
}
// Body onload utility
(supports multiple onload functions)
var gSafeOnload = new Array();
function SafeAddOnload(f)
{
isMac = (navigator.appVersion.indexOf("Mac")!=-1) ? true : false;
IEmac = ((document.all)&&(isMac)) ? true : false;
IE4 = ((document.all)&&(navigator.appVersion.indexOf("MSIE
4.")!=-1)) ? true : false;
if (IEmac && IE4) // IE 4.5 blows out on testing window.onload
{
window.onload = SafeOnload;
gSafeOnload[gSafeOnload.length] = f;
}
else if (window.onload)
{
if (window.onload != SafeOnload)
{
gSafeOnload[0] = window.onload;
window.onload = SafeOnload;
}
gSafeOnload[gSafeOnload.length] = f;
}
else
window.onload = f;
}
function SafeOnload()
{
for (var i=0;i<gSafeOnload.length;i++)
gSafeOnload[i]();
}
// Call the following
with your function as the argument
SafeAddOnload(SetupWindowClose);
</script>
<!-- end close
window script -->
|