Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

self close a popup box or window...

Status
Not open for further replies.

Ross1811

MIS
Oct 1, 2004
122
US
Hi everyone,

Just wondering if there is a way to self close a window in coldfusion or javascript. I can do it in javascript with a popup box but it still asks me if I am sure that I want to close the popup. I just want it to show then close itself after a certain time, any ideas?????? Here is the javascript

<html>
<head>
<script language="javascript">
function closeWin()
{
timer = setTimeout('checkForOpener()', 10000);
}

function checkForOpener(){
try{
var myVar=window.opener.document;
timer = setTimeout('checkForOpener()', 10000);
}catch(e){
window.close();
}
}
</script>
</head>
<body onLoad="closeWin()">
Testing...
</body>
</html>
 
if you use javascript to open a window you can use JS to close it. if you open a window manualy and try to use JS to close it you will be prompted. there was a work around for IE browsers a while back. you can ask the JS forum if it is still possible.

If the automobile had followed the same development cycle as the computer, a Rolls-Royce would today cost $100, get a million miles per gallon, and explode once a year, killing everyone inside.
 
There's a timer function that you can call and then if time is up, you close it in code on that page
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top