Click to See Complete Forum and Search --> : Closing pop ups


surfing fox
12-22-2003, 06:51 AM
Is it possible to have a link that when clicked it will close 3 browser windows and return to the home page?

olerag
12-22-2003, 08:20 AM
You can close them if they are "child" windows opened from
the "parent" browser window.

fredmv
12-22-2003, 06:05 PM
<script type="text/javascript">
//<![CDATA[
function launch()
{
for(i=0; i<3; i++) window['w'+i] = window.open('http://www.google.com/', '', 'height=200,width=400');
}

function destroy()
{
for(i=0; i<3; i++) if(typeof window['w'+i] != 'undefined' && !window['w'+i].closed) window['w'+i].close();
location = 'http://www.webdeveloper.com/';
}
//]]>
</script><span>
Options:
</span>
<ul>
<li><a href="#" onclick="launch();">Open three windows.</a></li>
<li><a href="#" onclick="destroy();">Close three windows and redirect to WebDeveloper.com</a></li>
</ul>

surfing fox
12-23-2003, 04:44 AM
Thanks!

fredmv
12-23-2003, 05:33 AM
You're quite welcome. ;)